Skip to content

Commit a84c930

Browse files
committed
Fix sorbet types of the jwt payload attr_reader
1 parent a14a221 commit a84c930

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/shopify_api/auth/jwt_payload.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ class JwtPayload
1010
JWT_EXPIRATION_LEEWAY = JWT_LEEWAY
1111

1212
sig { returns(String) }
13-
attr_reader :iss, :dest, :aud, :sub, :jti, :sid
13+
attr_reader :iss, :dest, :aud, :jti
1414

1515
sig { returns(Integer) }
1616
attr_reader :exp, :nbf, :iat
1717

18+
sig { returns(T.nilable(String)) }
19+
attr_reader :sub, :sid
20+
1821
alias_method :expire_at, :exp
1922

2023
sig { params(token: String).void }

lib/shopify_api/utils/session_utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def session_id_from_shopify_id_token(id_token:, online:)
4949
shop = payload.shop
5050

5151
if online
52-
jwt_session_id(shop, payload.sub)
52+
jwt_session_id(shop, T.must(payload.sub))
5353
else
5454
offline_session_id(shop)
5555
end

0 commit comments

Comments
 (0)