lib/matic-jwt/authenticator.rb in matic-jwt-1.0.1 vs lib/matic-jwt/authenticator.rb in matic-jwt-1.1.0

- old
+ new

@@ -11,19 +11,19 @@ def authenticate_with_secret!(secret) JWT.decode(@token, secret, true, algorithm: ALGORITHM) end + def payload + JWT.decode(@token, nil, false) + end + private def extract_token(header) token = header&.slice(@scheme.length + 1..-1) validate_header_presence!(token) token - end - - def payload - JWT.decode(@token, nil, false) end def validate_header_presence!(token) raise(JWT::DecodeError, 'Authorization token is incorrect') unless token&.present? end