stytch 3.9.0 → 3.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stytch/passwords.rb +35 -1
- data/lib/stytch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c3467a9df6c34d419a806c5822edd9878a6b17a60bc3abb7c85ab336695f25c
|
4
|
+
data.tar.gz: 8a7a8c5ea9f8247156d45b98b67708bf02bee10959269accb2cd5dc231787438
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63972fb9e432920750a1aedad82a1cd278305168dc38fc49cf987b288a8eeb857097a819d3c19c1f5ea65f9caf9978b06461fe9356e40b8390207e1471479446
|
7
|
+
data.tar.gz: b09cdec0f8430abac465cb0eae09183d71fda517019d4f583befa8f386207b4a941b7cdb4cd0bd9632facd053fca7c2734ef81e21351f159898d2375e11c9b6e
|
data/lib/stytch/passwords.rb
CHANGED
@@ -6,7 +6,7 @@ module Stytch
|
|
6
6
|
class Passwords
|
7
7
|
include Stytch::RequestHelper
|
8
8
|
|
9
|
-
attr_reader :email
|
9
|
+
attr_reader :email, :existing_password
|
10
10
|
|
11
11
|
PATH = '/v1/passwords'
|
12
12
|
|
@@ -14,6 +14,7 @@ module Stytch
|
|
14
14
|
@connection = connection
|
15
15
|
|
16
16
|
@email = Stytch::Passwords::Email.new(@connection)
|
17
|
+
@existing_password = Stytch::Passwords::ExistingPassword.new(@connection)
|
17
18
|
end
|
18
19
|
|
19
20
|
def create(
|
@@ -146,5 +147,38 @@ module Stytch
|
|
146
147
|
post_request("#{PATH}/reset", request)
|
147
148
|
end
|
148
149
|
end
|
150
|
+
|
151
|
+
class ExistingPassword
|
152
|
+
include Stytch::RequestHelper
|
153
|
+
|
154
|
+
PATH = "#{Stytch::Passwords::PATH}/existing_password"
|
155
|
+
|
156
|
+
def initialize(connection)
|
157
|
+
@connection = connection
|
158
|
+
end
|
159
|
+
|
160
|
+
def reset(
|
161
|
+
email:,
|
162
|
+
existing_password:,
|
163
|
+
new_password:,
|
164
|
+
session_token: nil,
|
165
|
+
session_jwt: nil,
|
166
|
+
session_duration_minutes: nil,
|
167
|
+
session_custom_claims: nil
|
168
|
+
)
|
169
|
+
request = {
|
170
|
+
email: email,
|
171
|
+
existing_password: existing_password,
|
172
|
+
new_password: new_password
|
173
|
+
}
|
174
|
+
|
175
|
+
request[:session_token] = session_token unless session_token.nil?
|
176
|
+
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
177
|
+
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
178
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
179
|
+
|
180
|
+
post_request("#{PATH}/reset", request)
|
181
|
+
end
|
182
|
+
end
|
149
183
|
end
|
150
184
|
end
|
data/lib/stytch/version.rb
CHANGED