Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
correct jwt payload
Browse files Browse the repository at this point in the history
  • Loading branch information
FinnIckler committed Oct 22, 2023
1 parent 0974e87 commit 57a5500
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def fetch_jwt_token(user_id)
iat = Time.now.to_i
jti_raw = [JwtOptions.secret, iat].join(':').to_s
jti = Digest::MD5.hexdigest(jti_raw)
payload = { data: { user_id: user_id }, exp: Time.now.to_i + JwtOptions.expiry, sub: user_id, iat: iat, jti: jti }
payload = { user_id: user_id , exp: Time.now.to_i + JwtOptions.expiry, sub: user_id, iat: iat, jti: jti }
token = JWT.encode payload, JwtOptions.secret, JwtOptions.algorithm
"Bearer #{token}"
end
Expand Down

0 comments on commit 57a5500

Please sign in to comment.