stytch 0.2.1 → 1.0.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 +12 -27
- data/lib/stytch/endpoints/user.rb +3 -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: f31f4c1727653f8dbdd402bb9e97d31ed7893f537c7f98923b3abfa6d1bbcc14
|
4
|
+
data.tar.gz: a3cdadaa143fcfc4e0d72b1d0f0e35246a254ff8482c56627fa6d7cb6cb2e898
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56aec4b2699da311092641a43150259a8315ff6c53a460377910dddebffb8c5f02986481a8ef9b8851bb40e25dfb46805b058055bef59b68d6a1d1b688c438fc
|
7
|
+
data.tar.gz: 07c8003263f90593c7c9e86920b8d866621e2890fb477e4d3b05eeb80c56b23c2cfab5913db80b76fe0b4be8d6260e26ce877f2000e8e3686515fce6a5867e5b
|
@@ -3,37 +3,22 @@ module Stytch
|
|
3
3
|
module Magic
|
4
4
|
PATH = "/v1/magic_links".freeze
|
5
5
|
|
6
|
-
def send_magic(
|
7
|
-
method_id:,
|
8
|
-
user_id:,
|
9
|
-
magic_link_url:,
|
10
|
-
expiration_minutes: nil,
|
11
|
-
attributes: {}
|
12
|
-
)
|
13
|
-
request = {
|
14
|
-
method_id: method_id,
|
15
|
-
user_id: user_id,
|
16
|
-
magic_link_url: magic_link_url,
|
17
|
-
}
|
18
|
-
|
19
|
-
request[:expiration_minutes] = expiration_minutes if expiration_minutes != nil
|
20
|
-
request[:attributes] = attributes if attributes != {}
|
21
|
-
|
22
|
-
post("#{PATH}/send", request)
|
23
|
-
end
|
24
|
-
|
25
6
|
def send_magic_by_email(
|
26
7
|
email:,
|
27
|
-
|
28
|
-
|
8
|
+
login_magic_link_url:,
|
9
|
+
signup_magic_link_url:,
|
10
|
+
login_expiration_minutes: nil,
|
11
|
+
signup_expiration_minutes: nil,
|
29
12
|
attributes: {}
|
30
13
|
)
|
31
14
|
request = {
|
32
15
|
email: email,
|
33
|
-
|
16
|
+
login_magic_link_url: login_magic_link_url,
|
17
|
+
signup_magic_link_url: signup_magic_link_url,
|
34
18
|
}
|
35
19
|
|
36
|
-
request[:
|
20
|
+
request[:login_expiration_minutes] = login_expiration_minutes if login_expiration_minutes != nil
|
21
|
+
request[:signup_expiration_minutes] = signup_expiration_minutes if signup_expiration_minutes != nil
|
37
22
|
request[:attributes] = attributes if attributes != {}
|
38
23
|
|
39
24
|
post("#{PATH}/send_by_email", request)
|
@@ -65,18 +50,18 @@ module Stytch
|
|
65
50
|
|
66
51
|
def invite_by_email(
|
67
52
|
email:,
|
68
|
-
|
69
|
-
|
53
|
+
invite_magic_link_url:,
|
54
|
+
invite_expiration_minutes: nil,
|
70
55
|
attributes: {},
|
71
56
|
name: {}
|
72
57
|
)
|
73
58
|
|
74
59
|
request = {
|
75
60
|
email: email,
|
76
|
-
|
61
|
+
invite_magic_link_url: invite_magic_link_url,
|
77
62
|
}
|
78
63
|
|
79
|
-
request[:
|
64
|
+
request[:invite_expiration_minutes] = invite_expiration_minutes if invite_expiration_minutes != nil
|
80
65
|
request[:attributes] = attributes if attributes != {}
|
81
66
|
request[:name] = name if name != {}
|
82
67
|
|
@@ -25,11 +25,13 @@ module Stytch
|
|
25
25
|
email: nil,
|
26
26
|
phone_number: nil,
|
27
27
|
name: {},
|
28
|
+
create_user_as_pending: false,
|
28
29
|
attributes: {}
|
29
30
|
)
|
30
31
|
request = {
|
31
32
|
email: email,
|
32
|
-
phone_number: phone_number
|
33
|
+
phone_number: phone_number,
|
34
|
+
create_user_as_pending: create_user_as_pending
|
33
35
|
}
|
34
36
|
|
35
37
|
request[:name] = name if name != {}
|
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: 1.0.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-
|
11
|
+
date: 2021-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|