stytch 0.1.5 → 0.1.7

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: 31244e7b0111ee9e38bc46a5fb575345e14cb4ac07f9d839776c8729d0b2f09c
4
- data.tar.gz: 47417725b12c525e71286a92b567a5deb47fae820d2703a0ad7b6cef89eea83e
3
+ metadata.gz: be9237c8c5508d86e48b380ecbc379bdc5eacde5409b6c656f9a110b159e7a26
4
+ data.tar.gz: 6c3681406de7d46108658c5a39711d7e3a512839b9bdccb729c97e88dda120ef
5
5
  SHA512:
6
- metadata.gz: f7410c8dc1858dbcb3dd2375074f1630bd845082f44431cdd2f55a512f0d5307d0df78b7d8feb68508f7d533fda0a866ee8e1d68e26e2a911190956d2ba2f07a
7
- data.tar.gz: 8308b3f6b7caa3a26bf3484be4a88829a291225e79e890fdfdcaca8d1af2698ec15cdbb6628ca4b7429625d4caf059fecd466d51fb61eeee342fc9c11e761b7e
6
+ metadata.gz: 1f210e1218345e389d363cd7d92b7c8fac4c04a07e4058aa9d3d0196461e0b1ecc7e0d5694b6c52bf1a2e59b57981e191e8978f1617cfd8482434514a2cd0546
7
+ data.tar.gz: 43ed7e6c709c94ea8d1f7aecf0b04b7cfdac245f977637618bea496e7b173435c19dae6887a11215aa5facec598d3227669cf26be87506b4d865118fdfa54d3c
@@ -16,10 +16,11 @@ module Stytch
16
16
  user_id: user_id,
17
17
  magic_link_url: magic_link_url,
18
18
  expiration_minutes: expiration_minutes,
19
- template_id: template_id,
20
- attributes: attributes
21
19
  }
22
20
 
21
+ request[:template_id] = template_id if template_id != nil
22
+ request[:attributes] = attributes if attributes != {}
23
+
23
24
  post("#{PATH}/send", request)
24
25
  end
25
26
 
@@ -34,22 +35,23 @@ module Stytch
34
35
  email: email,
35
36
  magic_link_url: magic_link_url,
36
37
  expiration_minutes: expiration_minutes,
37
- template_id: template_id,
38
- attributes: attributes
39
38
  }
40
39
 
40
+ request[:template_id] = template_id if template_id != nil
41
+ request[:attributes] = attributes if attributes != {}
42
+
41
43
  post("#{PATH}/send_by_email", request)
42
44
  end
43
45
 
44
46
  def authenticate_magic(
45
47
  token:,
46
48
  attributes: {},
47
- options:{}
49
+ options: {}
48
50
  )
49
- request = {
50
- attributes: attributes,
51
- options: options
52
- }
51
+ request = {}
52
+
53
+ request[:attributes] = attributes if attributes != {}
54
+ request[:options] = options if options != {}
53
55
 
54
56
  post("#{PATH}/#{token}/authenticate", request)
55
57
  end
@@ -14,10 +14,11 @@ module Stytch
14
14
  )
15
15
  request = {
16
16
  email: email,
17
- name: name,
18
- attributes: attributes,
19
17
  }
20
18
 
19
+ request[:name] = name if name != {}
20
+ request[:attributes] = attributes if attributes != {}
21
+
21
22
  post(PATH, request)
22
23
  end
23
24
 
@@ -30,9 +31,10 @@ module Stytch
30
31
  request = {
31
32
  name: name,
32
33
  emails: format_emails(emails),
33
- attributes: attributes,
34
34
  }
35
35
 
36
+ request[:attributes] = attributes if attributes != {}
37
+
36
38
  put("#{PATH}/#{user_id}", request)
37
39
  end
38
40
 
@@ -1,3 +1,3 @@
1
1
  module Stytch
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.7"
3
3
  end
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.5
4
+ version: 0.1.7
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-05 00:00:00.000000000 Z
11
+ date: 2020-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday