diff --git a/lib/shopify_api/auth/jwt_payload.rb b/lib/shopify_api/auth/jwt_payload.rb index 9a81730b..bd13326c 100644 --- a/lib/shopify_api/auth/jwt_payload.rb +++ b/lib/shopify_api/auth/jwt_payload.rb @@ -6,7 +6,8 @@ module Auth class JwtPayload extend T::Sig - JWT_EXPIRATION_LEEWAY = 10 + JWT_LEEWAY = 10 + JWT_EXPIRATION_LEEWAY = JWT_LEEWAY sig { returns(String) } attr_reader :iss, :dest, :aud, :sub, :jti, :sid @@ -73,7 +74,7 @@ def ==(other) sig { params(token: String, api_secret_key: String).returns(T::Hash[String, T.untyped]) } def decode_token(token, api_secret_key) - JWT.decode(token, api_secret_key, true, leeway: JWT_EXPIRATION_LEEWAY, algorithm: "HS256")[0] + JWT.decode(token, api_secret_key, true, leeway: JWT_LEEWAY, algorithm: "HS256")[0] rescue JWT::DecodeError => err raise ShopifyAPI::Errors::InvalidJwtTokenError, "Error decoding session token: #{err.message}" end