twilio_phone_verification 1.0.3 → 1.0.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe1584bb5bfbe310924ef50f196fcc07b831641d
|
4
|
+
data.tar.gz: 6db8b60de46da61ce42bc383082a429eb9abcc5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95e4c0f3a91b8cb3966319d6192bc8b4603a117d5b7ba37bc64594f94a396a881684474c8a17f5a10b12dec566ead9a610dcb25df9a5015c1353c89540d3bd35
|
7
|
+
data.tar.gz: b09770ce8c9940400ed662226db58f7c77dff2c3a96599140900ec32ceec76600211a43ead5582b773a62b14f88a089fe4d4de4c8441990ee9fe67fdf023b8a3
|
@@ -35,7 +35,7 @@ module TwilioPhoneVerification::Phonable
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def confirm_phone_by_code(code)
|
38
|
-
if ActiveSupport::SecurityUtils.secure_compare phone_confirmation_token, code
|
38
|
+
if ActiveSupport::SecurityUtils.secure_compare phone_confirmation_token, code.to_s
|
39
39
|
return confirm_phone
|
40
40
|
else
|
41
41
|
errors.add(:code, " is wrong, try again.")
|
@@ -64,11 +64,10 @@ module TwilioPhoneVerification::Phonable
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def get_phone_confirmation_token
|
67
|
-
(0..9).to_a.
|
67
|
+
(0..9).to_a.sample(6)
|
68
68
|
end
|
69
69
|
|
70
70
|
def phone_confirmation_message
|
71
|
-
return false unless phone_confirmation_token
|
72
71
|
"Hello, #{name}. Your verification code: #{phone_confirmation_token}"
|
73
72
|
end
|
74
73
|
end
|
@@ -7,9 +7,9 @@ require "twilio-ruby"
|
|
7
7
|
require "phony_rails"
|
8
8
|
|
9
9
|
module TwilioPhoneVerification
|
10
|
-
def self.configure
|
11
|
-
yield configuration
|
12
|
-
raise "
|
10
|
+
def self.configure
|
11
|
+
yield configuration if block_given?
|
12
|
+
raise "TwilioPhoneVerification configuration error" unless configuration.account_sid && configuration.auth_token && configuration.from
|
13
13
|
Twilio.configure do |config|
|
14
14
|
config.account_sid = configuration.account_sid
|
15
15
|
config.auth_token = configuration.auth_token
|