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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93e1f89bed0f2c91f7caac140e7dc10b154d116eda9a0b89078f48336da15fcb
4
- data.tar.gz: 736f9a25fd2e902024fab4ff5ce01eb21b26f8562d02236f6fc3f16bf37c63c0
3
+ metadata.gz: 8c3467a9df6c34d419a806c5822edd9878a6b17a60bc3abb7c85ab336695f25c
4
+ data.tar.gz: 8a7a8c5ea9f8247156d45b98b67708bf02bee10959269accb2cd5dc231787438
5
5
  SHA512:
6
- metadata.gz: 345ddac68abf1011f6cca16fa1115b3b45bfe9067b6b66883bc3fb57aad5f374c9174333473cefaab5314175fe42aa2cf840d89cc6112c4ba95513b79cc7db50
7
- data.tar.gz: 437f1988244668c730bef3106ebca258c6b4ed846ebceef93d186a38bc0ea97e39dff6d6dd129790935a6b170c9580aff7c9736c7f0e1aaf42c344d8e5e8d900
6
+ metadata.gz: 63972fb9e432920750a1aedad82a1cd278305168dc38fc49cf987b288a8eeb857097a819d3c19c1f5ea65f9caf9978b06461fe9356e40b8390207e1471479446
7
+ data.tar.gz: b09cdec0f8430abac465cb0eae09183d71fda517019d4f583befa8f386207b4a941b7cdb4cd0bd9632facd053fca7c2734ef81e21351f159898d2375e11c9b6e
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stytch
4
- VERSION = '3.9.0'
4
+ VERSION = '3.10.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stytch
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.0
4
+ version: 3.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - stytch