1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 03:17:04 +00:00

auth: add an option to enforce the secure attr of the set-cookie

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-04-02 18:17:47 +03:00
parent 2f9ddff5a9
commit 872dd45359
4 changed files with 13 additions and 4 deletions

View File

@@ -526,7 +526,7 @@ func (s *Auth[T]) trySetCookie(ctx *context.Context, accessToken string) {
Name: cookieName,
Value: url.QueryEscape(accessToken),
HttpOnly: true,
Secure: ctx.IsSSL(),
Secure: s.config.Cookie.Secure || ctx.IsSSL(),
Domain: ctx.Domain(),
SameSite: http.SameSiteLaxMode,
Expires: time.Now().Add(maxAge),