twilio_phone_verification 1.0.3 → 1.0.4

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
  SHA1:
3
- metadata.gz: 9b1b724e323c0bc5ed148f3476759790f55c5f65
4
- data.tar.gz: 1ee664767913ebdfababf580add2a92d27e8b2e6
3
+ metadata.gz: fe1584bb5bfbe310924ef50f196fcc07b831641d
4
+ data.tar.gz: 6db8b60de46da61ce42bc383082a429eb9abcc5e
5
5
  SHA512:
6
- metadata.gz: f294b0dfb8d1aecadd4d8a4628067175140dc290b43697ed48c85dd58631945228d41615aea3c5d4f4a93f4511c4e67d5d582e4c338ea8844eb8e457563f4e91
7
- data.tar.gz: a09bc027587402ff076f94be671d7aa9164d8309e396966f8447516d9cd1388cddecf9f1fb4fce7be5ef29362b7337dcd8e746322641fd7d766b469774ef3e45
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.shuffle[0,6].join
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
@@ -1,3 +1,3 @@
1
1
  module TwilioPhoneVerification
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
@@ -7,9 +7,9 @@ require "twilio-ruby"
7
7
  require "phony_rails"
8
8
 
9
9
  module TwilioPhoneVerification
10
- def self.configure(&block)
11
- yield configuration
12
- raise "Configuration error" unless configuration.account_sid && configuration.auth_token && configuration.from
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twilio_phone_verification
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - vishgleb@mail.ru