Skip to content

Commit

Permalink
fix(auth): delete cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
HeRaNO committed Mar 7, 2024
1 parent 279ebf7 commit ffd1e53
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/handlers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package handlers
import (
"context"
"errors"
"net/http"

"github.com/HeRaNO/xcpc-team-reg/internal"
"github.com/HeRaNO/xcpc-team-reg/internal/dal/rdb"
Expand Down Expand Up @@ -102,7 +103,11 @@ func Logout(ctx context.Context, c *app.RequestContext) {
return
}
session.Options(sessions.Options{
MaxAge: -1,
Path: "/",
Domain: internal.Domain,
MaxAge: -1,
HttpOnly: true,
SameSite: http.SameSiteLaxMode,
})
if err := session.Save(); err != nil {
hlog.Errorf("Logout(): save session failed, err: %+v", err)
Expand Down

0 comments on commit ffd1e53

Please sign in to comment.