stytch 2.9.0 → 2.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: 8b1b869e6182a03431f7159bcfde6544be7d21819449f95cb53a69cc6534a433
4
- data.tar.gz: b54b8ca4edc62df234546d6f681562b053a1b31677aa090b2ffa7577bbff318f
3
+ metadata.gz: c2b973d686af6ce37a2f1d51825d075f0b361ad75eb06ee0d74df0ba343543bc
4
+ data.tar.gz: 4649dc2a86ddcb0013bfe8f1cee480fa8f0533fa52eabe4531fad4bc8acf0432
5
5
  SHA512:
6
- metadata.gz: cb5bda40dc3bf05a2e09b0637723febf156c443587d82286fe9112739aa747f2572d9884aeed8b95a05f79d6ef16cdd9d84da50fc5bd6d7228a4a05d9e288cd9
7
- data.tar.gz: 0ab2ec0d82e2d5cd0b1056d02209e0b4c248d2e63ce2b9820cee56fd100381b80eae0ec3e962e92f0c4b8f86725707faa750c9b3f7ce6dd87847da4cb601f7b1
6
+ metadata.gz: 1e34d2f40645f2393c8573ce667c36fdff565c4918133b4bedc800b70c5e406822b33f85a5a95981bda8ceeaf4196ae3816ce863c20ac04b2f847b00be6b10c5
7
+ data.tar.gz: 97ad61637feec32db2b4e20927385c248b566c2c32ccc47e32be27a33d93363e04449e314357b30ed42fdaf645beab9e7464377d7b7b45be9df36ff37b03272c
data/lib/stytch/client.rb CHANGED
@@ -37,7 +37,7 @@ module Stytch
37
37
  when :live
38
38
  'https://api.stytch.com'
39
39
  when :test
40
- 'https://test.stytch.com'
40
+ 'https://test.nikhil.dev.stytch.com'
41
41
  else
42
42
  raise ArgumentError, "Invalid value for env (#{@env}): should be live or test"
43
43
  end
data/lib/stytch/totps.rb CHANGED
@@ -54,13 +54,18 @@ module Stytch
54
54
 
55
55
  def recover(
56
56
  user_id:,
57
- recovery_code:
57
+ recovery_code:,
58
+ session_token: nil,
59
+ session_duration_minutes: nil
58
60
  )
59
61
  request = {
60
62
  user_id: user_id,
61
63
  recovery_code: recovery_code
62
64
  }
63
65
 
66
+ request[:session_token] = session_token unless session_token.nil?
67
+ request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
68
+
64
69
  post_request("#{PATH}/recover", request)
65
70
  end
66
71
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stytch
4
- VERSION = '2.9.0'
4
+ VERSION = '2.10.0'
5
5
  end
data/lib/stytch.rb CHANGED
@@ -8,3 +8,16 @@ require_relative 'stytch/middleware'
8
8
  require_relative 'stytch/version'
9
9
 
10
10
  module Stytch end
11
+
12
+ client = Stytch::Client.new(
13
+ env: :test,
14
+ project_id: "project-test-2a934f44-a014-425d-aa1d-76f2d0344db7",
15
+ secret: "secret-test-z5kbR31dkcTnocolLJT77gkyX9KJQeU9umg="
16
+ )
17
+
18
+ resp = client.totps.authenticate(
19
+ user_id: "user-test-fa9e1ba8-6786-4a7c-923f-a76a2b82e6a5",
20
+ totp_code: "021363",
21
+ session_token: "HLr0NGPZkyn7xA9Vc9XFjOIDjUafuTumOT6au3-PqM83",
22
+ )
23
+ puts resp
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: 2.9.0
4
+ version: 2.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - stytch
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-13 00:00:00.000000000 Z
11
+ date: 2022-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -50,7 +50,7 @@ dependencies:
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '2.0'
53
- description:
53
+ description:
54
54
  email:
55
55
  - support@stytch.com
56
56
  executables: []
@@ -88,7 +88,7 @@ licenses:
88
88
  metadata:
89
89
  homepage_uri: https://stytch.com
90
90
  source_code_uri: https://github.com/stytchauth/stytch-ruby
91
- post_install_message:
91
+ post_install_message:
92
92
  rdoc_options: []
93
93
  require_paths:
94
94
  - lib
@@ -103,8 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.1.4
107
- signing_key:
106
+ rubygems_version: 3.0.3
107
+ signing_key:
108
108
  specification_version: 4
109
109
  summary: Stytch Ruby Gem
110
110
  test_files: []