Fix cookie weirdness (delete correctly using MaxAge)
This commit is contained in:
parent
18e07e322f
commit
9b3743e79a
2 changed files with 7 additions and 4 deletions
|
@ -156,6 +156,7 @@ func (a *Auth) routeRefresh(w http.ResponseWriter, r *http.Request) {
|
|||
cookie := &http.Cookie{
|
||||
Name: "jwt",
|
||||
Value: tok,
|
||||
Path: "/",
|
||||
HttpOnly: true,
|
||||
Secure: true,
|
||||
}
|
||||
|
@ -216,6 +217,7 @@ func (a *Auth) routeAuth(w http.ResponseWriter, r *http.Request) {
|
|||
cookie := &http.Cookie{
|
||||
Name: "jwt",
|
||||
Value: tok,
|
||||
Path: "/",
|
||||
HttpOnly: true,
|
||||
Secure: true,
|
||||
}
|
||||
|
@ -242,9 +244,10 @@ func (a *Auth) routeLogout(w http.ResponseWriter, r *http.Request) {
|
|||
cookie := &http.Cookie{
|
||||
Name: "jwt",
|
||||
Value: "",
|
||||
Path: "/",
|
||||
HttpOnly: true,
|
||||
Secure: true,
|
||||
Expires: time.Time{},
|
||||
MaxAge: -1,
|
||||
}
|
||||
|
||||
if a.allowInsecureCookie(r) {
|
||||
|
|
Loading…
Reference in a new issue