devise_phone 0.0.166 → 0.0.1661

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: d84f53c91af193de70b439975e4f247dd3922780
4
- data.tar.gz: 16b6ef3ca7880f20a66f1f86b1077ef6fdbf8bb6
3
+ metadata.gz: bbe42d3c22685ac7b09bd947b1c2f104851d60a5
4
+ data.tar.gz: fd6796e5978e541bf11e71db29b23db842be60ba
5
5
  SHA512:
6
- metadata.gz: f9272243f242ac73e93b138cf899d56117afb466f55e84223e60e84172270b35f7116860e3d68a6a591fa8e3a0bfe8e08f7c0384b670cbc958ab4e2004fcb917
7
- data.tar.gz: 855579cc46f14b8fc30dc073eae39e9232ec47240fc5d43f791de1ed2afa8ac62294e2230d9eb4b3101f76cd1635da0ad48dc3ce2dcae09726e7c961f432b750
6
+ metadata.gz: d1f251105637d81644f7d46f32cd461b55c75e92870f0f364c2de210cb837fb5d87b3d717a44c52f580677132443128f8f5027fafc0deba3a5074a6d4ce781de
7
+ data.tar.gz: 9622833e283c0581371135e7824c2cab59cd9ccb2073ecdb20a875ee8d3977739da131f1ceb7962cd47a0790c1341f790419dfdc5ae998749ed923e3e92e5ff8
data/README.rdoc CHANGED
@@ -1,28 +1,27 @@
1
- = devise_sms_confirmation
1
+ = devise_phone
2
2
 
3
- Devise Phone is a snap-in for Devise that will make any resource activable via SMS.
4
- The user will receive an SMS with a token that can be entered on the site to activate the account.
5
- Ask the user his phone (and phone confirmation to double check) on registration and the token will be sended automagically.
6
-
7
- == Installation for Rails >= 3.0 and Devise >= 1.1
8
-
9
- Install DevisePhone gem, it will also install dependencies (such as devise and warden):
10
-
11
- gem install devise_phone
3
+ The user will receive an SMS with a token that can be entered on the site to activate the phone number.
4
+ Ask the user his phone and the token will be sended automagically.
12
5
 
13
6
  Add DevisePhone to your Gemfile (and Devise and TwilioRuby if you weren't using them):
14
7
 
15
- gem 'devise', '~> 3.4.1'
16
- gem 'twilio-ruby', '~> 4.2.0'
17
- gem 'devise_phone', '~> 0.0.1'
8
+ gem 'devise'
9
+ gem 'twilio-ruby'
10
+ gem 'devise_phone'
18
11
 
19
12
  === Automatic installation
20
13
 
14
+ Run:
15
+ rails generate devise:install
16
+ rails generate devise MODEL
17
+ rails generate devise:views MODEL
18
+ before installing devise_phone in your Rails app
19
+
21
20
  Run the following generator to add DevisePhone’s configuration option in the Devise configuration file (config/initializers/devise.rb) and the sms sender class in your lib folder:
22
21
 
23
22
  rails generate devise_phone:install
24
23
 
25
- When you are done, you are ready to add DevisePhone to any of your Devise models using the following generator:
24
+ When you are done, you are ready to add DevisePhone to any of your Devise models using the following generator:
26
25
 
27
26
  rails generate devise_phone MODEL
28
27
 
@@ -34,7 +33,7 @@ All the views are packaged inside the gem. If you'd like to customize the views,
34
33
 
35
34
  rails generate devise_phone:views
36
35
 
37
- You can also use the generator to generate scoped views:
36
+ You can also use the generator to generate scoped views: (This might not work yet)
38
37
 
39
38
  rails generate devise_phone:views users
40
39
 
@@ -42,30 +41,40 @@ Please refer to {Devise's README}[http://github.com/plataformatec/devise] for mo
42
41
 
43
42
  == Usage
44
43
 
45
- The model is specular to the Devise's own Confirmable model. It only requires the user to supply a valid phone number.
44
+ Don't forget to add phone_number as one of the permitted parameters. This is an example of doing so:
45
+
46
+ class ApplicationController < ActionController::Base
47
+ # Prevent CSRF attacks by raising an exception.
48
+ # For APIs, you may want to use :null_session instead.
49
+ protect_from_forgery with: :exception
50
+
51
+ before_filter :configure_permitted_parameters
46
52
 
47
- On registration it will send an SMS with a token to be inserted to complete activation process.
48
- By default users MUST activate by SMS before entering.
49
- If you want something more "relaxed" just override <tt>sms_confirmation_required?</tt> in your model and make it your way.
50
- You can use the convenience filter <tt>require_sms_activated!</tt> in your controller to block sms-unactive users from specific pages.
53
+ protected
51
54
 
52
- == Controller filter
55
+ # my custom fields are :name, :heard_how
56
+ def configure_permitted_parameters
57
+ devise_parameter_sanitizer.for(:sign_up) do |u|
58
+ u.permit(:phone_number,
59
+ :email, :password, :password_confirmation)
60
+ end
61
+ devise_parameter_sanitizer.for(:account_update) do |u|
62
+ u.permit(:phone_number,
63
+ :email, :password, :password_confirmation, :current_password)
64
+ end
65
+ end
66
+ end
53
67
 
54
- DevisePhone extends your controllers with a <tt>require_sms_activated!</tt> method. Use it to restrict part of the site to "confirmed users" only
68
+ The resend verification code button can be inserted to any page just by using:
69
+ <%= render 'devise/phone/resend_code' %>
55
70
 
56
- == I18n
71
+ The activate phone field and button can be inserted to any page just by using:
72
+ <%= render 'devise/phone/activate_phone' %>
57
73
 
58
- DevisePhone installs a localizable file in your config/locales folder.
59
74
 
60
75
  == Contributing to devise_phone
61
76
 
62
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
63
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
64
- * Fork the project
65
- * Start a feature/bugfix branch
66
- * Commit and push until you are happy with your contribution
67
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
68
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
77
+ * email htheodore@gmail.com
69
78
 
70
79
  == Copyright
71
80
 
@@ -1,3 +1,3 @@
1
1
  module DevisePhone
2
- VERSION = "0.0.166".freeze
2
+ VERSION = "0.0.1661".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_phone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.166
4
+ version: 0.0.1661
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hubert Theodore