Skip to content

Commit d562893

Browse files
committed
fix: error messages on newer crystal versions
1 parent 56b7915 commit d562893

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jwt.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ module JWT
248248
unless Crypto::Subtle.constant_time_compare(aud.to_s, payload_aud.as_s)
249249
raise InvalidAudienceError.new("Invalid audience (aud). Expected #{aud.inspect}, received #{payload_aud.raw.inspect}")
250250
end
251-
elsif auds = payload_aud.as_a?
251+
elsif auds = payload_aud.as_a?.try(&.map(&.raw))
252252
if !auds.includes?(aud)
253253
msg = "Invalid audience (aud). Expected #{aud.inspect}, received #{auds.inspect}"
254254
raise InvalidAudienceError.new(msg)

0 commit comments

Comments
 (0)