add age to acess token

This commit is contained in:
Kenta420-Poom 2023-09-21 14:27:05 +07:00
parent dbc741ccf6
commit 5a84d89d5d

View file

@ -88,7 +88,7 @@ func (ar *AuthRouter) Route(r chi.Router) {
}
// redirect to frontend with token and refresh token
w.Header().Add("set-cookie", "access_token="+token.AccessToken+"; Path=/; HttpOnly; SameSite=None; Secure")
w.Header().Add("set-cookie", "access_token="+token.AccessToken+"; Path=/; HttpOnly; SameSite=None; Secure; Max-Age=3600")
w.Header().Add("set-cookie", "refresh_token="+token.RefreshToken+"; Path=/; HttpOnly; SameSite=None; Secure")
http.Redirect(w, r, ar.cfg.ClientRedirectURL+"/callback?"+value.Encode(), http.StatusTemporaryRedirect)
})