Class: ShopifyApp::JWT
- Inherits:
-
Object
- Object
- ShopifyApp::JWT
- Defined in:
- lib/shopify_app/session/jwt.rb
Constant Summary collapse
- WARN_EXCEPTIONS =
[ ::JWT::DecodeError, ::JWT::ExpiredSignature, ::JWT::ImmatureSignature, ::JWT::VerificationError, ::ShopifyApp::InvalidAudienceError, ::ShopifyApp::InvalidDestinationError, ::ShopifyApp::MismatchedHostsError, ]
Instance Method Summary collapse
- #expire_at ⇒ Object
-
#initialize(token) ⇒ JWT
constructor
A new instance of JWT.
- #shopify_domain ⇒ Object
- #shopify_user_id ⇒ Object
Constructor Details
#initialize(token) ⇒ JWT
Returns a new instance of JWT.
15 16 17 18 19 |
# File 'lib/shopify_app/session/jwt.rb', line 15 def initialize(token) warn_deprecation @token = token set_payload end |
Instance Method Details
#expire_at ⇒ Object
29 30 31 |
# File 'lib/shopify_app/session/jwt.rb', line 29 def expire_at @payload["exp"].to_i if @payload && @payload["exp"] end |
#shopify_domain ⇒ Object
21 22 23 |
# File 'lib/shopify_app/session/jwt.rb', line 21 def shopify_domain @payload && ShopifyApp::Utils.sanitize_shop_domain(@payload["dest"]) end |
#shopify_user_id ⇒ Object
25 26 27 |
# File 'lib/shopify_app/session/jwt.rb', line 25 def shopify_user_id @payload["sub"].to_i if @payload && @payload["sub"] end |