Skip to content

Commit 917eaeb

Browse files
committed
feat: don't set cookie in case of offline_access
1 parent 3bb90ac commit 917eaeb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/handlers/authorize.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func AuthorizeHandler() gin.HandlerFunc {
275275
sessionstore.RemoveState(sessionToken)
276276
sessionstore.SetState(authToken.FingerPrintHash, authToken.FingerPrint+"@"+user.ID)
277277
sessionstore.SetState(authToken.AccessToken.Token, authToken.FingerPrint+"@"+user.ID)
278-
cookie.SetSession(gc, authToken.FingerPrintHash)
278+
279279
expiresIn := int64(1800)
280280

281281
// used of query mode
@@ -294,6 +294,9 @@ func AuthorizeHandler() gin.HandlerFunc {
294294
res["refresh_token"] = authToken.RefreshToken.Token
295295
params += "&refresh_token=" + authToken.RefreshToken.Token
296296
sessionstore.SetState(authToken.AccessToken.Token, authToken.FingerPrint+"@"+user.ID)
297+
} else {
298+
// set session if not offline access
299+
cookie.SetSession(gc, authToken.FingerPrintHash)
297300
}
298301

299302
if isQuery {

0 commit comments

Comments
 (0)