feat: don't set cookie in case of offline_access

This commit is contained in:
Lakhan Samani 2022-03-08 18:51:46 +05:30
parent 3bb90acc9e
commit 917eaeb2ed

View File

@ -275,7 +275,7 @@ func AuthorizeHandler() gin.HandlerFunc {
sessionstore.RemoveState(sessionToken)
sessionstore.SetState(authToken.FingerPrintHash, authToken.FingerPrint+"@"+user.ID)
sessionstore.SetState(authToken.AccessToken.Token, authToken.FingerPrint+"@"+user.ID)
cookie.SetSession(gc, authToken.FingerPrintHash)
expiresIn := int64(1800)
// used of query mode
@ -294,6 +294,9 @@ func AuthorizeHandler() gin.HandlerFunc {
res["refresh_token"] = authToken.RefreshToken.Token
params += "&refresh_token=" + authToken.RefreshToken.Token
sessionstore.SetState(authToken.AccessToken.Token, authToken.FingerPrint+"@"+user.ID)
} else {
// set session if not offline access
cookie.SetSession(gc, authToken.FingerPrintHash)
}
if isQuery {