mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-07 00:46:58 +03:00
*: allows for BASE_PATH configuration (#183)
This commit is contained in:
parent
90bb2851bf
commit
87b08a8f7c
13 changed files with 108 additions and 84 deletions
|
@ -14,9 +14,9 @@ func ValidSession(next echo.HandlerFunc) echo.HandlerFunc {
|
|||
if !isValidSession(c) {
|
||||
nextURL := c.Request().URL
|
||||
if nextURL != nil && c.Request().Method == http.MethodGet {
|
||||
return c.Redirect(http.StatusTemporaryRedirect, fmt.Sprintf("/login?next=%s", c.Request().URL))
|
||||
return c.Redirect(http.StatusTemporaryRedirect, fmt.Sprintf(util.BasePath + "/login?next=%s", c.Request().URL))
|
||||
} else {
|
||||
return c.Redirect(http.StatusTemporaryRedirect, "/login")
|
||||
return c.Redirect(http.StatusTemporaryRedirect, util.BasePath + "/login")
|
||||
}
|
||||
}
|
||||
return next(c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue