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: ad2b9e0329bfb6ecaea13ee52644361d0c3097a0175faeed7bdc6827ac9a58bc
4
- data.tar.gz: 765826d474cac75927011b92d389c3d789181f2af47350915e787dc197ac74c5
3
+ metadata.gz: cbb5428fac2da11423f3bf156dc1d9171e123ea9157caef25719cf5bdd49adee
4
+ data.tar.gz: aca23d4fe32ca783757e5631effe4c4d3724d39099d9cbb3333386ba9b91138f
5
5
  SHA512:
6
- metadata.gz: 2f7d2a8717ecc17fb0f0c17da71f63551828f64a76711967fce110266988c9d63eda2f13060a0ef3971d0ebea86c5e8a427c5c2564a39eef2800cb58cb8981c8
7
- data.tar.gz: de07cf26df1b30341ae5b4d7f0d55c73cbdbee8958a178b47e1569f8e415890cf406f4bc0ebb61ff1c85ff52eddaa1ce5eb6cc2d8fddeab226c7738e3fb02594
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 user.phone_number.present?
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: user.phone_number)
73
- log(level: :info, msg: "Sent twilio message to #{user.phone_number}")
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 #{user.phone_number}")
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
@@ -1,7 +1,7 @@
1
1
  module RailsBase
2
2
  MAJOR = "0"
3
- MINOR = "81"
4
- PATCH = "1"
3
+ MINOR = "82"
4
+ PATCH = "0"
5
5
  VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}"
6
6
 
7
7
  def self.print_version
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.81.1
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-02 00:00:00.000000000 Z
11
+ date: 2024-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: allow_numeric