Skip to content

Commit

Permalink
Removed: Redundant type forcing to simple addition
Browse files Browse the repository at this point in the history
  • Loading branch information
DLzer committed Mar 13, 2024
1 parent 286d74e commit 8d07ade
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions recipe/session/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,14 @@ func SetAccessTokenInResponse(config sessmodels.TypeNormalisedInput, res http.Re
// This should be safe to do, since this is only the validity of the cookie (set here or on the frontend) but we check the expiration of the JWT anyway.
// Even if the token is expired the presence of the token indicates that the user could have a valid refresh
// Setting them to infinity would require special case handling on the frontend and just adding 100 years seems enough.
setToken(config, res, sessmodels.AccessToken, accessToken, GetCurrTimeInMS()+uint64(accessTokenCookiesExpiryDurationMillis), tokenTransferMethod, request, userContext)
setToken(config, res, sessmodels.AccessToken, accessToken, GetCurrTimeInMS()+accessTokenCookiesExpiryDurationMillis, tokenTransferMethod, request, userContext)

if config.ExposeAccessTokenToFrontendInCookieBasedAuth && tokenTransferMethod == sessmodels.CookieTransferMethod {
// We set the expiration to 100 years, because we can't really access the expiration of the refresh token everywhere we are setting it.
// This should be safe to do, since this is only the validity of the cookie (set here or on the frontend) but we check the expiration of the JWT anyway.
// Even if the token is expired the presence of the token indicates that the user could have a valid refresh
// Setting them to infinity would require special case handling on the frontend and just adding 100 years seems enough.
setToken(config, res, sessmodels.AccessToken, accessToken, GetCurrTimeInMS()+uint64(accessTokenCookiesExpiryDurationMillis), sessmodels.HeaderTransferMethod, request, userContext)
setToken(config, res, sessmodels.AccessToken, accessToken, GetCurrTimeInMS()+accessTokenCookiesExpiryDurationMillis, sessmodels.HeaderTransferMethod, request, userContext)
}
return nil
}
Expand Down

0 comments on commit 8d07ade

Please sign in to comment.