rails_base 0.81.1 → 0.82.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbb5428fac2da11423f3bf156dc1d9171e123ea9157caef25719cf5bdd49adee
|
4
|
+
data.tar.gz: aca23d4fe32ca783757e5631effe4c4d3724d39099d9cbb3333386ba9b91138f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 569fd7065ded45e8c41cd89fd33a58e6ce5b3c0e92daf292ccb065884348c7528590d6f3ce8e4a80aee6f5e82b892afcb85a18aad3b42a3c8a0f536d39e3e16d
|
7
|
+
data.tar.gz: 59edca98f8fb2d0f6061643b7f9c86c6ef6108ceedc796334e222a2da97aa74cb266e6c8a04f149b0e99dc727408e99b0c34adb833fb8d514413011711ac8fe8
|
@@ -58,7 +58,7 @@ module RailsBase::Authentication
|
|
58
58
|
# This method is expected to be overridden by the main app
|
59
59
|
# This is expected default behavior if SSO is available
|
60
60
|
def sso_decision_type
|
61
|
-
if
|
61
|
+
if phone.present?
|
62
62
|
SSO_DECISION_TWILIO
|
63
63
|
elsif user.email_validated
|
64
64
|
SSO_DECISION_EMAIL
|
@@ -69,15 +69,19 @@ module RailsBase::Authentication
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def send_to_twilio!(message:)
|
72
|
-
TwilioJob.perform_later(message: message, to:
|
73
|
-
log(level: :info, msg: "Sent twilio message to #{
|
72
|
+
TwilioJob.perform_later(message: message, to: phone)
|
73
|
+
log(level: :info, msg: "Sent twilio message to #{phone}")
|
74
74
|
rescue StandardError => e
|
75
75
|
log(level: :error, msg: "Error caught #{e.class.name}")
|
76
76
|
log(level: :error, msg: "Error caught #{e.message}")
|
77
|
-
log(level: :error, msg: "Failed to send sms to #{
|
77
|
+
log(level: :error, msg: "Failed to send sms to #{phone}")
|
78
78
|
context.fail!(message: "Failed to send sms to user. Try again.")
|
79
79
|
end
|
80
80
|
|
81
|
+
def phone
|
82
|
+
context.phone_number || user.phone_number
|
83
|
+
end
|
84
|
+
|
81
85
|
def send_to_email!(message:)
|
82
86
|
RailsBase::EventMailer.send_sso(user: user, message: message).deliver_me
|
83
87
|
rescue StandardError => e
|
data/lib/rails_base/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.82.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: allow_numeric
|