Skip to content

Commit

Permalink
Claims verification fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tuwukee committed Sep 21, 2024
1 parent 8f6fb24 commit f421307
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/jwt_sessions/authorization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ def request_method
end

def valid_csrf_token?(csrf_token, token_type)
JWTSessions::Session.new(claims).valid_csrf?(found_token, csrf_token, token_type)
JWTSessions::Session.new(session_claims).valid_csrf?(found_token, csrf_token, token_type)
end

def session_exists?(token_type)
JWTSessions::Session.new(claims).session_exists?(found_token, token_type)
JWTSessions::Session.new(session_claims).session_exists?(found_token, token_type)
end

def cookieless_auth(token_type)
Expand Down Expand Up @@ -151,10 +151,11 @@ def authorize_request(token_type)
check_csrf(token_type)
end

def claims
def session_claims
claims = respond_to?(:token_claims) ? token_claims : {}
{
access_claims: token_claims,
refresh_claims: token_claims
access_claims: claims,
refresh_claims: claims
}
end
end
Expand Down

0 comments on commit f421307

Please sign in to comment.