stytch 0.1.13 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/stytch/client.rb +12 -0
- data/lib/stytch/endpoints/magic.rb +3 -23
- data/lib/stytch/endpoints/user.rb +12 -2
- data/lib/stytch/version.rb +1 -1
- data/stytch.gemspec +2 -2
- metadata +27 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10463d08a00797477107bd2ddbc5019ed64387affed2383ed96c977a26477520
|
4
|
+
data.tar.gz: 7445343227668660e5560bb6078e6c02d1108b5126424b5cecd21eed8cbeba3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5576d825603203b8a86dcd7496eb7011ce6cf085999340a66b46584814ccfbb07427afe7e5c77f57f55920ea9f693a7ad11c1cc2ae085a3258f52a5204a24a61
|
7
|
+
data.tar.gz: b12847701543b4a833d10b65625e568e1f4571742de26c0b59c8bb75e295e41718c844e3bd792ad2c5ec9583398bf70586cc8700e4c4eefbd465a14ed24f75a4
|
data/README.md
CHANGED
data/lib/stytch/client.rb
CHANGED
@@ -69,5 +69,17 @@ module Stytch
|
|
69
69
|
path
|
70
70
|
).body
|
71
71
|
end
|
72
|
+
|
73
|
+
def request_with_query_params(path, params)
|
74
|
+
request = path
|
75
|
+
params.compact.each_with_index do |p, i|
|
76
|
+
if i == 0
|
77
|
+
request += "?#{p[0].to_s}=#{p[1]}"
|
78
|
+
else
|
79
|
+
request += "&#{p[0].to_s}=#{p[1]}"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
request
|
83
|
+
end
|
72
84
|
end
|
73
85
|
end
|
@@ -45,13 +45,15 @@ module Stytch
|
|
45
45
|
signup_magic_link_url:,
|
46
46
|
login_expiration_minutes: nil,
|
47
47
|
signup_expiration_minutes: nil,
|
48
|
-
attributes: {}
|
48
|
+
attributes: {},
|
49
|
+
create_user_as_pending: false
|
49
50
|
)
|
50
51
|
|
51
52
|
request = {
|
52
53
|
email: email,
|
53
54
|
login_magic_link_url: login_magic_link_url,
|
54
55
|
signup_magic_link_url: signup_magic_link_url,
|
56
|
+
create_user_as_pending: create_user_as_pending,
|
55
57
|
}
|
56
58
|
|
57
59
|
request[:login_expiration_minutes] = login_expiration_minutes if login_expiration_minutes != nil
|
@@ -61,28 +63,6 @@ module Stytch
|
|
61
63
|
post("#{PATH}/login_or_create", request)
|
62
64
|
end
|
63
65
|
|
64
|
-
def login_or_invite_by_email(
|
65
|
-
email:,
|
66
|
-
login_magic_link_url:,
|
67
|
-
invite_magic_link_url:,
|
68
|
-
login_expiration_minutes: nil,
|
69
|
-
invite_expiration_minutes: nil,
|
70
|
-
attributes: {}
|
71
|
-
)
|
72
|
-
|
73
|
-
request = {
|
74
|
-
email: email,
|
75
|
-
login_magic_link_url: login_magic_link_url,
|
76
|
-
invite_magic_link_url: invite_magic_link_url,
|
77
|
-
}
|
78
|
-
|
79
|
-
request[:login_expiration_minutes] = login_expiration_minutes if login_expiration_minutes != nil
|
80
|
-
request[:invite_expiration_minutes] = invite_expiration_minutes if invite_expiration_minutes != nil
|
81
|
-
request[:attributes] = attributes if attributes != {}
|
82
|
-
|
83
|
-
post("#{PATH}/login_or_invite", request)
|
84
|
-
end
|
85
|
-
|
86
66
|
def invite_by_email(
|
87
67
|
email:,
|
88
68
|
magic_link_url:,
|
@@ -7,8 +7,18 @@ module Stytch
|
|
7
7
|
get("#{PATH}/#{user_id}")
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
11
|
-
|
10
|
+
def get_pending_users(
|
11
|
+
limit: nil,
|
12
|
+
starting_after_id: nil
|
13
|
+
)
|
14
|
+
query_params = {
|
15
|
+
limit: limit,
|
16
|
+
starting_after_id: starting_after_id,
|
17
|
+
}
|
18
|
+
|
19
|
+
request = request_with_query_params("#{PATH}/pending", query_params)
|
20
|
+
|
21
|
+
get(request)
|
12
22
|
end
|
13
23
|
|
14
24
|
def create_user(
|
data/lib/stytch/version.rb
CHANGED
data/stytch.gemspec
CHANGED
@@ -23,6 +23,6 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ["lib"]
|
25
25
|
|
26
|
-
spec.add_dependency 'faraday', '
|
27
|
-
spec.add_dependency 'faraday_middleware', '
|
26
|
+
spec.add_dependency 'faraday', '>= 0.17.0', '< 2.0'
|
27
|
+
spec.add_dependency 'faraday_middleware', '>= 0.14.0', '< 2.0'
|
28
28
|
end
|
metadata
CHANGED
@@ -1,44 +1,56 @@
|
|
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.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alex-stytch
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.17.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.17.0
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: '2.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: faraday_middleware
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - "
|
37
|
+
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
39
|
+
version: 0.14.0
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '2.0'
|
34
43
|
type: :runtime
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
37
46
|
requirements:
|
38
|
-
- - "
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.14.0
|
50
|
+
- - "<"
|
39
51
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
41
|
-
description:
|
52
|
+
version: '2.0'
|
53
|
+
description:
|
42
54
|
email:
|
43
55
|
- alex@stytch.com
|
44
56
|
executables: []
|
@@ -68,7 +80,7 @@ licenses:
|
|
68
80
|
metadata:
|
69
81
|
homepage_uri: https://stytch.com
|
70
82
|
source_code_uri: https://github.com/stytchauth/stytch-ruby
|
71
|
-
post_install_message:
|
83
|
+
post_install_message:
|
72
84
|
rdoc_options: []
|
73
85
|
require_paths:
|
74
86
|
- lib
|
@@ -83,8 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
95
|
- !ruby/object:Gem::Version
|
84
96
|
version: '0'
|
85
97
|
requirements: []
|
86
|
-
rubygems_version: 3.
|
87
|
-
signing_key:
|
98
|
+
rubygems_version: 3.0.3
|
99
|
+
signing_key:
|
88
100
|
specification_version: 4
|
89
101
|
summary: Stytch Ruby Gem
|
90
102
|
test_files: []
|