stytch 0.1.7 → 0.1.8
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 +52 -0
- 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: f78c9a111464963c4c5720743961c8fa40109900c867e0771b06e009f3940ade
|
4
|
+
data.tar.gz: 9594ec5391ab2679511291c8057945008afeb9e3b2012d1bf28e9cb41179c701
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbf40c48a6fd68f8cf86b1b6f0e3362baa66c7354477f146fbd3bbab2ddf9b83882470b39ef1a76dcd786ce87435ce8e059f575622323f9fd664ce87ccbd6c15
|
7
|
+
data.tar.gz: 1337d3a4020bed0a65c847d2b92717895bb1059336c85f40648d4d65973d4223e76cad8995242502bc6dd0169bb000f88dca5205de2ff5ff94a011c4f4cca9b0
|
@@ -43,6 +43,58 @@ module Stytch
|
|
43
43
|
post("#{PATH}/send_by_email", request)
|
44
44
|
end
|
45
45
|
|
46
|
+
def login_or_create_user(
|
47
|
+
email:,
|
48
|
+
login_magic_link_url:,
|
49
|
+
signup_magic_link_url:,
|
50
|
+
login_expiration_minutes: nil,
|
51
|
+
signup_expiration_minutes: nil,
|
52
|
+
login_template_id: nil,
|
53
|
+
signup_template_id: nil,
|
54
|
+
attributes: {}
|
55
|
+
)
|
56
|
+
|
57
|
+
request = {
|
58
|
+
email: email,
|
59
|
+
login_magic_link_url: login_magic_link_url,
|
60
|
+
signup_magic_link_url: signup_magic_link_url,
|
61
|
+
}
|
62
|
+
|
63
|
+
request[:login_template_id] = login_template_id if login_template_id != nil
|
64
|
+
request[:login_expiration_minutes] = login_expiration_minutes if login_expiration_minutes != nil
|
65
|
+
request[:signup_template_id] = signup_template_id if signup_template_id != nil
|
66
|
+
request[:signup_expiration_minutes] = signup_expiration_minutes if signup_expiration_minutes != nil
|
67
|
+
request[:attributes] = attributes if attributes != {}
|
68
|
+
|
69
|
+
post("#{PATH}/login_or_create", request)
|
70
|
+
end
|
71
|
+
|
72
|
+
def login_or_invite_by_email(
|
73
|
+
email:,
|
74
|
+
login_magic_link_url:,
|
75
|
+
invite_magic_link_url:,
|
76
|
+
login_expiration_minutes: nil,
|
77
|
+
invite_expiration_minutes: nil,
|
78
|
+
login_template_id: nil,
|
79
|
+
signup_template_id: nil,
|
80
|
+
attributes: {}
|
81
|
+
)
|
82
|
+
|
83
|
+
request = {
|
84
|
+
email: email,
|
85
|
+
login_magic_link_url: login_magic_link_url,
|
86
|
+
invite_magic_link_url: invite_magic_link_url,
|
87
|
+
}
|
88
|
+
|
89
|
+
request[:login_template_id] = login_template_id if login_template_id != nil
|
90
|
+
request[:login_expiration_minutes] = login_expiration_minutes if login_expiration_minutes != nil
|
91
|
+
request[:invite_template_id] = invite_template_id if invite_template_id != nil
|
92
|
+
request[:invite_expiration_minutes] = invite_expiration_minutes if invite_expiration_minutes != nil
|
93
|
+
request[:attributes] = attributes if attributes != {}
|
94
|
+
|
95
|
+
post("#{PATH}/login_or_invite", request)
|
96
|
+
end
|
97
|
+
|
46
98
|
def authenticate_magic(
|
47
99
|
token:,
|
48
100
|
attributes: {},
|
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.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alex-stytch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|