fix: set cookie Secure=true and SameSite=None for cross-origin auth
This commit is contained in:
parent
5ce0980090
commit
3583ef89d8
1 changed files with 1345 additions and 1345 deletions
|
|
@ -121,8 +121,8 @@ func (h *CoreHandlers) Login(w http.ResponseWriter, r *http.Request) {
|
|||
Path: "/",
|
||||
Expires: time.Now().Add(24 * time.Hour),
|
||||
HttpOnly: true,
|
||||
Secure: false, // Set to true in production with HTTPS
|
||||
SameSite: http.SameSiteLaxMode,
|
||||
Secure: true,
|
||||
SameSite: http.SameSiteNoneMode,
|
||||
})
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
|
@ -143,8 +143,8 @@ func (h *CoreHandlers) Logout(w http.ResponseWriter, r *http.Request) {
|
|||
Path: "/",
|
||||
Expires: time.Now().Add(-24 * time.Hour), // Expire in the past
|
||||
HttpOnly: true,
|
||||
Secure: false, // Set to true in production with HTTPS
|
||||
SameSite: http.SameSiteLaxMode,
|
||||
Secure: true,
|
||||
SameSite: http.SameSiteNoneMode,
|
||||
MaxAge: -1, // Delete cookie immediately
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue