mirror of
https://github.com/h44z/wg-portal.git
synced 2026-02-23 10:56:22 +00:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e47d8c3e9 | ||
|
|
eb28492539 | ||
|
|
d1a4ddde10 | ||
|
|
b1637b0c4e | ||
|
|
0cc7ebb83e | ||
|
|
eb6a787cfc | ||
|
|
b546eec4ed | ||
|
|
9be2133220 | ||
|
|
b05837b2d9 | ||
|
|
08c8f8eac0 | ||
|
|
d864e24145 | ||
|
|
5b56e58fe9 | ||
|
|
930ef7b573 | ||
|
|
18296673d7 | ||
|
|
4ccc59c109 | ||
|
|
e6b01a9903 | ||
|
|
2f79dd04c0 | ||
|
|
e5ed9736b3 | ||
|
|
c8353b85ae | ||
|
|
6142031387 | ||
|
|
dd86d0ff49 | ||
|
|
bdd426a679 |
@@ -1,7 +1,7 @@
|
||||
export function base64_url_encode(input) {
|
||||
let output = btoa(input)
|
||||
output = output.replace('+', '.')
|
||||
output = output.replace('/', '_')
|
||||
output = output.replace('=', '-')
|
||||
output = output.replaceAll('+', '.')
|
||||
output = output.replaceAll('/', '_')
|
||||
output = output.replaceAll('=', '-')
|
||||
return output
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-pkgz/routegroup"
|
||||
@@ -449,7 +448,17 @@ func (e AuthEndpoint) handleLogoutPost() http.HandlerFunc {
|
||||
|
||||
// isValidReturnUrl checks if the given return URL matches the configured external URL of the application.
|
||||
func (e AuthEndpoint) isValidReturnUrl(returnUrl string) bool {
|
||||
if !strings.HasPrefix(returnUrl, e.cfg.Web.ExternalUrl) {
|
||||
expectedUrl, err := url.Parse(e.cfg.Web.ExternalUrl)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
returnUrlParsed, err := url.Parse(returnUrl)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if returnUrlParsed.Scheme != expectedUrl.Scheme || returnUrlParsed.Host != expectedUrl.Host {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -217,6 +217,15 @@ func (m Manager) RestoreInterfaceState(
|
||||
if err != nil && !iface.IsDisabled() {
|
||||
slog.Debug("creating missing interface", "interface", iface.Identifier, "backend", controller.GetId())
|
||||
|
||||
// temporarily disable interface in database so that the current state is reflected correctly
|
||||
_ = m.db.SaveInterface(ctx, iface.Identifier,
|
||||
func(in *domain.Interface) (*domain.Interface, error) {
|
||||
now := time.Now()
|
||||
in.Disabled = &now // set
|
||||
in.DisabledReason = domain.DisabledReasonInterfaceMissing
|
||||
return in, nil
|
||||
})
|
||||
|
||||
// temporarily disable interface in database so that the current state is reflected correctly
|
||||
_ = m.db.SaveInterface(ctx, iface.Identifier,
|
||||
func(in *domain.Interface) (*domain.Interface, error) {
|
||||
|
||||
Reference in New Issue
Block a user