stytch 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/stytch/sessions.rb +7 -1
- data/lib/stytch/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dc4550a480f46589fd16edc9445850c3b291a1972a5715a00dccab129df2595f
|
|
4
|
+
data.tar.gz: b18030ff8be340da133c636ff137fb5b60c727d09b5132a3e76148144d6aadee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bde5b7238e9e3f3e83a341e619ad0fe0b02f5902a7740f42b0fea42a636baaadd559c931b28c9df59d534ee89de0df62e48df44e6627ef4a9a280a16b073dea7
|
|
7
|
+
data.tar.gz: f713601765602a2376a32cb13a63058e337a0648aa9c28f8d0591d5062e7871a812832620c0607524ae34fc56d6833df75420397ffd66a6b99241cee8b9b9bc5
|
data/lib/stytch/sessions.rb
CHANGED
|
@@ -88,6 +88,12 @@ module Stytch
|
|
|
88
88
|
session_duration_minutes: session_duration_minutes,
|
|
89
89
|
)
|
|
90
90
|
end
|
|
91
|
+
rescue StandardError
|
|
92
|
+
# JWT could not be verified locally. Check with the Stytch API.
|
|
93
|
+
return authenticate(
|
|
94
|
+
session_jwt: session_jwt,
|
|
95
|
+
session_duration_minutes: session_duration_minutes,
|
|
96
|
+
)
|
|
91
97
|
end
|
|
92
98
|
|
|
93
99
|
# Parse a JWT and verify the signature locally (without calling /authenticate in the API)
|
|
@@ -97,7 +103,7 @@ module Stytch
|
|
|
97
103
|
def authenticate_jwt_local(session_jwt)
|
|
98
104
|
issuer = "stytch.com/" + @project_id
|
|
99
105
|
begin
|
|
100
|
-
decoded_token = JWT.decode session_jwt, nil, true,
|
|
106
|
+
decoded_token = JWT.decode session_jwt, nil, true,
|
|
101
107
|
{ jwks: @jwks_loader, iss: issuer, verify_iss: true, aud: @project_id, verify_aud: true, algorithms: ["RS256"]}
|
|
102
108
|
return decoded_token[0]
|
|
103
109
|
rescue JWT::InvalidIssuerError
|
data/lib/stytch/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stytch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- stytch
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-05-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|