mirror of https://github.com/jlelse/GoBlog
Fix cookies for auth and captcha
This commit is contained in:
parent
be929058cf
commit
bb73d4831c
|
@ -121,8 +121,8 @@ func createTokenCookie(username string) (*http.Cookie, error) {
|
||||||
Name: "token",
|
Name: "token",
|
||||||
Value: tokenString,
|
Value: tokenString,
|
||||||
Expires: expiration,
|
Expires: expiration,
|
||||||
Secure: true,
|
Secure: httpsConfigured(),
|
||||||
HttpOnly: true,
|
HttpOnly: true,
|
||||||
SameSite: http.SameSiteStrictMode,
|
SameSite: http.SameSiteLaxMode,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,8 +105,8 @@ func createCaptchaCookie() (*http.Cookie, error) {
|
||||||
Name: "captcha",
|
Name: "captcha",
|
||||||
Value: tokenString,
|
Value: tokenString,
|
||||||
Expires: expiration,
|
Expires: expiration,
|
||||||
Secure: true,
|
Secure: httpsConfigured(),
|
||||||
HttpOnly: true,
|
HttpOnly: true,
|
||||||
SameSite: http.SameSiteStrictMode,
|
SameSite: http.SameSiteLaxMode,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue