stytch 0.1.21 → 0.2.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/endpoints/magic.rb +17 -17
- data/lib/stytch/endpoints/otp.rb +18 -18
- data/lib/stytch/endpoints/user.rb +11 -12
- 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: d64be302698661b1c67aa6bc25276bf60e3963f686eb8f82788652ab765c62c8
|
4
|
+
data.tar.gz: 1073eeb1593ed3289cbb86105f44785eb35f803c36a0f89a7882bdef43161e0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20322948ece90536400226cf146b60695986217c9757b9cd6b786551d7d4c2d111740390a68dd447549463d55eaa46b39d1cd2f71d93b8f88784726b88193eb3
|
7
|
+
data.tar.gz: 1f736fbdd2c71ba191544e9d3ee18dc0b5468e7cd38f088a7979d5ee351fc31df32f2b366a7202f7a726900faa48036019b1deb8ad821ec69ad9b0faf2f39ec6
|
@@ -4,16 +4,16 @@ module Stytch
|
|
4
4
|
PATH = "/v1/magic_links".freeze
|
5
5
|
|
6
6
|
def send_magic(
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
method_id:,
|
8
|
+
user_id:,
|
9
|
+
magic_link_url:,
|
10
|
+
expiration_minutes: nil,
|
11
|
+
attributes: {}
|
12
12
|
)
|
13
13
|
request = {
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
method_id: method_id,
|
15
|
+
user_id: user_id,
|
16
|
+
magic_link_url: magic_link_url,
|
17
17
|
}
|
18
18
|
|
19
19
|
request[:expiration_minutes] = expiration_minutes if expiration_minutes != nil
|
@@ -23,14 +23,14 @@ module Stytch
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def send_magic_by_email(
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
email:,
|
27
|
+
magic_link_url:,
|
28
|
+
expiration_minutes: nil,
|
29
|
+
attributes: {}
|
30
30
|
)
|
31
31
|
request = {
|
32
|
-
|
33
|
-
|
32
|
+
email: email,
|
33
|
+
magic_link_url: magic_link_url,
|
34
34
|
}
|
35
35
|
|
36
36
|
request[:expiration_minutes] = expiration_minutes if expiration_minutes != nil
|
@@ -95,9 +95,9 @@ module Stytch
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def authenticate_magic(
|
98
|
-
|
99
|
-
|
100
|
-
|
98
|
+
token:,
|
99
|
+
attributes: {},
|
100
|
+
options: {}
|
101
101
|
)
|
102
102
|
request = {}
|
103
103
|
|
data/lib/stytch/endpoints/otp.rb
CHANGED
@@ -4,13 +4,13 @@ module Stytch
|
|
4
4
|
PATH = "/v1/otp".freeze
|
5
5
|
|
6
6
|
def send_otp_by_sms(
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
phone_number:,
|
8
|
+
expiration_minutes: nil,
|
9
|
+
attributes: {}
|
10
10
|
)
|
11
11
|
request = {
|
12
|
-
|
13
|
-
|
12
|
+
phone_number: phone_number,
|
13
|
+
expiration_minutes: expiration_minutes,
|
14
14
|
}
|
15
15
|
|
16
16
|
request[:attributes] = attributes if attributes != {}
|
@@ -19,15 +19,15 @@ module Stytch
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def login_or_create_user_by_sms(
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
phone_number:,
|
23
|
+
expiration_minutes: nil,
|
24
|
+
attributes: {},
|
25
|
+
create_user_as_pending: false
|
26
26
|
)
|
27
27
|
request = {
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
phone_number: phone_number,
|
29
|
+
expiration_minutes: expiration_minutes,
|
30
|
+
create_user_as_pending: create_user_as_pending
|
31
31
|
}
|
32
32
|
|
33
33
|
request[:attributes] = attributes if attributes != {}
|
@@ -36,14 +36,14 @@ module Stytch
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def authenticate_otp(
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
method_id:,
|
40
|
+
code:,
|
41
|
+
attributes: {},
|
42
|
+
options: {}
|
43
43
|
)
|
44
44
|
request = {
|
45
|
-
|
46
|
-
|
45
|
+
method_id: method_id,
|
46
|
+
code: code,
|
47
47
|
}
|
48
48
|
|
49
49
|
request[:attributes] = attributes if attributes != {}
|
@@ -8,8 +8,8 @@ module Stytch
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def get_pending_users(
|
11
|
-
|
12
|
-
|
11
|
+
limit: nil,
|
12
|
+
starting_after_id: nil
|
13
13
|
)
|
14
14
|
query_params = {
|
15
15
|
limit: limit,
|
@@ -22,10 +22,10 @@ module Stytch
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def create_user(
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
email:,
|
26
|
+
phone_number: nil,
|
27
|
+
name: {},
|
28
|
+
attributes: {}
|
29
29
|
)
|
30
30
|
request = {
|
31
31
|
email: email,
|
@@ -46,8 +46,8 @@ module Stytch
|
|
46
46
|
attributes: {}
|
47
47
|
)
|
48
48
|
request = {
|
49
|
-
|
50
|
-
|
49
|
+
emails: format_emails(emails),
|
50
|
+
phone_numbers: format_phone_numbers(phone_numbers),
|
51
51
|
}
|
52
52
|
|
53
53
|
request[:name] = name if name != {}
|
@@ -61,14 +61,13 @@ module Stytch
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def delete_user_email(
|
64
|
-
|
65
|
-
email:
|
64
|
+
email_id:
|
66
65
|
)
|
67
|
-
delete("#{PATH}
|
66
|
+
delete("#{PATH}/emails/#{email_id}")
|
68
67
|
end
|
69
68
|
|
70
69
|
def delete_user_phone_number(
|
71
|
-
|
70
|
+
phone_id:
|
72
71
|
)
|
73
72
|
delete("#{PATH}/phone_numbers/#{phone_id}")
|
74
73
|
end
|
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: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alex-stytch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|