*: allows for BASE_PATH configuration (#183)

This commit is contained in:
Quentin Machu 2022-04-25 00:17:13 -07:00 committed by GitHub
parent 90bb2851bf
commit 87b08a8f7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 108 additions and 84 deletions

View file

@ -53,7 +53,7 @@ func Login(db store.IStore) echo.HandlerFunc {
// TODO: refresh the token
sess, _ := session.Get("session", c)
sess.Options = &sessions.Options{
Path: "/",
Path: util.BasePath,
MaxAge: 86400,
HttpOnly: true,
}
@ -82,7 +82,7 @@ func Login(db store.IStore) echo.HandlerFunc {
func Logout() echo.HandlerFunc {
return func(c echo.Context) error {
clearSession(c)
return c.Redirect(http.StatusTemporaryRedirect, "/login")
return c.Redirect(http.StatusTemporaryRedirect, util.BasePath + "/login")
}
}