devise_sms_confirmable 0.1.16 → 0.1.17

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: 750ac29541d9079dae8b3750d785cf5b8a9fd49ad0c7be8a159d0681c0687c86
4
- data.tar.gz: b154451a79ee1a106120d3143f0aaacf2e6b42c16499a3fd7b20788a6610759a
3
+ metadata.gz: 0e48132fe8f049a59c4132004cb1058fd482e63e1125a7547ff1d3bb5fe25bea
4
+ data.tar.gz: 99b5a0f6bc24d7a6c1a4f35001b7e8c6a17663d6ed091a44cfffc9313b054cf8
5
5
  SHA512:
6
- metadata.gz: 0dabbafe45db1246735bd1b43e632e6bc4dc92b572bdc910f93db434676ec82a0283b6dd2894a6ac889f68022c856fc07e16f61be0009c4b9893aa491ba776a0
7
- data.tar.gz: fc970a3637e85b1277da0dd7cd9c17def39d2fb54eb32db2a33d73c763b4c14c9bede15b7118e1946d37816f8c379c423fa5f15712e37328ffc546ffb62ee5b1
6
+ metadata.gz: d06f5881545332ed233008e862bafb1af659920b52bcf410cda96ab62aa1f054702a528079221373840a5235e51f4ab3b4e2ab99943838a3d65885a056807f73
7
+ data.tar.gz: 9d8867071103f6737a5bb907a140d81741429440ca6cdb8400a40f4d36b350a15dfa482b57b5db946dffbc2b2478e5ff0506e12827ccef33b9b3993d066edb34
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devise_sms_confirmable (0.1.16)
4
+ devise_sms_confirmable (0.1.17)
5
5
  devise (>= 4.6.2)
6
6
  rails (~> 5.1.4)
7
7
  textris (~> 0.7)
@@ -19,16 +19,24 @@ class Devise::SmsConfirmationsController < DeviseController
19
19
  end
20
20
  end
21
21
 
22
- # GET /resource/sms_confirmation?sms_confirmation_token=abcdef
23
- def show
24
- self.resource = resource_class.sms_confirm_by_token(params[:sms_confirmation_token])
22
+ # GET /resource/sms_confirmation/edit?phone=abcdef
23
+ def edit
24
+ self.resource = resource_class.find_by_phone(confirmation_params[:phone])
25
+
26
+ if resource.blank?
27
+ redirect_to sms_confirmation_path and return
28
+ end
29
+ end
30
+
31
+ def update
32
+ self.resource = resource_class.sms_confirm_by_token(confirmation_params[:sms_confirmation_token])
25
33
  yield resource if block_given?
26
34
 
27
35
  if resource.errors.empty?
28
- set_flash_message!(:notice, :confirmed)
36
+ set_flash_message!(:notice, :sms_confirmed)
29
37
  respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource) }
30
38
  else
31
- respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new }
39
+ respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :show }
32
40
  end
33
41
  end
34
42
 
@@ -36,7 +44,7 @@ class Devise::SmsConfirmationsController < DeviseController
36
44
 
37
45
  # The path used after resending confirmation instructions.
38
46
  def after_resending_confirmation_instructions_path_for(resource_name)
39
- is_navigational_format? ? new_session_path(resource_name) : '/'
47
+ is_navigational_format? ? sms_confirmation_path(resource_name) : '/'
40
48
  end
41
49
 
42
50
  # The path used after confirmation.
@@ -125,10 +125,6 @@ module Devise
125
125
  @skip_sms_reconfirmation_in_callback = true
126
126
  end
127
127
 
128
- def devise_texter
129
- Devise.texter
130
- end
131
-
132
128
  def sms_confirmation_period_valid?
133
129
  return true if self.class.allow_sms_unconfirmed_access_for.nil?
134
130
  return false if self.class.allow_sms_unconfirmed_access_for == 0.days
@@ -3,7 +3,7 @@ module ActionDispatch::Routing
3
3
  protected
4
4
 
5
5
  def devise_sms_confirmation(mapping, controllers)
6
- resource :sms_confirmation, only: [:new, :create, :show], path: mapping.path_names[:sms_confirmation], controller: controllers[:sms_confirmations]
6
+ resource :sms_confirmation, only: [:new, :create, :show, :edit, :update], path: mapping.path_names[:sms_confirmation], controller: controllers[:sms_confirmations]
7
7
  end
8
8
  end
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module DeviseSmsConfirmable
2
- VERSION = "0.1.16"
2
+ VERSION = "0.1.17"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_sms_confirmable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - uuushiro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-04 00:00:00.000000000 Z
11
+ date: 2019-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise