Skip to content

Commit

Permalink
fix order
Browse files Browse the repository at this point in the history
  • Loading branch information
ami-descope committed Sep 5, 2024
1 parent 28ef32d commit a18a5aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/descope/api/v1/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@ def generate_auth_info(response_body, refresh_token, user_jwt, audience = nil)
# validate refresh token if refresh_token was passed or if refreshJwt is not empty
rt_jwt = response_body.fetch('refreshJwt', '')

# if refresh_token is in response body (local storage)
if refresh_token && !refresh_token.empty?
jwt_response[REFRESH_SESSION_TOKEN_NAME] = validate_token(refresh_token, audience)
elsif !rt_jwt.empty?
if !rt_jwt.empty?
jwt_response[REFRESH_SESSION_TOKEN_NAME] = validate_token(rt_jwt, audience)
elsif refresh_token && !refresh_token.empty?
# if refresh_token is in response body (local storage)
jwt_response[REFRESH_SESSION_TOKEN_NAME] = validate_token(refresh_token, audience)
else
cookies = response_body.fetch('cookies', {})
# else if refresh token is in response cookie
Expand Down

0 comments on commit a18a5aa

Please sign in to comment.