devise-bootstrap 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +31 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +29 -0
  6. data/Rakefile +1 -0
  7. data/app/controllers/devise/confirmations_controller.rb +47 -0
  8. data/app/controllers/devise/omniauth_callbacks_controller.rb +30 -0
  9. data/app/controllers/devise/passwords_controller.rb +70 -0
  10. data/app/controllers/devise/registrations_controller.rb +137 -0
  11. data/app/controllers/devise/sessions_controller.rb +53 -0
  12. data/app/controllers/devise/unlocks_controller.rb +46 -0
  13. data/app/controllers/devise_controller.rb +176 -0
  14. data/app/helpers/devise_helper.rb +25 -0
  15. data/app/mailers/devise/mailer.rb +20 -0
  16. data/app/views/devise/confirmations/new.html.erb +12 -0
  17. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  18. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  19. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  20. data/app/views/devise/passwords/edit.html.erb +16 -0
  21. data/app/views/devise/passwords/new.html.erb +12 -0
  22. data/app/views/devise/registrations/edit.html.erb +29 -0
  23. data/app/views/devise/registrations/new.html.erb +18 -0
  24. data/app/views/devise/sessions/new.html.erb +17 -0
  25. data/app/views/devise/shared/_links.erb +25 -0
  26. data/app/views/devise/unlocks/new.html.erb +12 -0
  27. data/config/locales/en.yml +59 -0
  28. data/devise-bootstrap.gemspec +30 -0
  29. data/gemfiles/Gemfile.rails-3.2-stable +29 -0
  30. data/gemfiles/Gemfile.rails-4.0-stable +29 -0
  31. data/gemfiles/Gemfile.rails-head +29 -0
  32. data/lib/devise/bootstrap.rb +7 -0
  33. data/lib/devise/bootstrap/version.rb +5 -0
  34. data/lib/devise/devise.rb +491 -0
  35. data/lib/devise/devise/controllers/helpers.rb +213 -0
  36. data/lib/devise/devise/controllers/rememberable.rb +47 -0
  37. data/lib/devise/devise/controllers/scoped_views.rb +17 -0
  38. data/lib/devise/devise/controllers/sign_in_out.rb +103 -0
  39. data/lib/devise/devise/controllers/store_location.rb +50 -0
  40. data/lib/devise/devise/controllers/url_helpers.rb +67 -0
  41. data/lib/devise/devise/delegator.rb +16 -0
  42. data/lib/devise/devise/failure_app.rb +205 -0
  43. data/lib/devise/devise/hooks/activatable.rb +11 -0
  44. data/lib/devise/devise/hooks/csrf_cleaner.rb +5 -0
  45. data/lib/devise/devise/hooks/forgetable.rb +9 -0
  46. data/lib/devise/devise/hooks/lockable.rb +7 -0
  47. data/lib/devise/devise/hooks/proxy.rb +21 -0
  48. data/lib/devise/devise/hooks/rememberable.rb +7 -0
  49. data/lib/devise/devise/hooks/timeoutable.rb +28 -0
  50. data/lib/devise/devise/hooks/trackable.rb +9 -0
  51. data/lib/devise/devise/mailers/helpers.rb +90 -0
  52. data/lib/devise/devise/mapping.rb +172 -0
  53. data/lib/devise/devise/models.rb +119 -0
  54. data/lib/devise/devise/models/authenticatable.rb +284 -0
  55. data/lib/devise/devise/models/confirmable.rb +295 -0
  56. data/lib/devise/devise/models/database_authenticatable.rb +164 -0
  57. data/lib/devise/devise/models/lockable.rb +196 -0
  58. data/lib/devise/devise/models/omniauthable.rb +27 -0
  59. data/lib/devise/devise/models/recoverable.rb +131 -0
  60. data/lib/devise/devise/models/registerable.rb +25 -0
  61. data/lib/devise/devise/models/rememberable.rb +129 -0
  62. data/lib/devise/devise/models/timeoutable.rb +49 -0
  63. data/lib/devise/devise/models/trackable.rb +35 -0
  64. data/lib/devise/devise/models/validatable.rb +66 -0
  65. data/lib/devise/devise/modules.rb +28 -0
  66. data/lib/devise/devise/omniauth.rb +28 -0
  67. data/lib/devise/devise/omniauth/config.rb +45 -0
  68. data/lib/devise/devise/omniauth/url_helpers.rb +18 -0
  69. data/lib/devise/devise/orm/active_record.rb +3 -0
  70. data/lib/devise/devise/orm/mongoid.rb +3 -0
  71. data/lib/devise/devise/parameter_filter.rb +40 -0
  72. data/lib/devise/devise/parameter_sanitizer.rb +99 -0
  73. data/lib/devise/devise/rails.rb +56 -0
  74. data/lib/devise/devise/rails/routes.rb +496 -0
  75. data/lib/devise/devise/rails/warden_compat.rb +22 -0
  76. data/lib/devise/devise/strategies/authenticatable.rb +167 -0
  77. data/lib/devise/devise/strategies/base.rb +20 -0
  78. data/lib/devise/devise/strategies/database_authenticatable.rb +23 -0
  79. data/lib/devise/devise/strategies/rememberable.rb +55 -0
  80. data/lib/devise/devise/test_helpers.rb +132 -0
  81. data/lib/devise/devise/time_inflector.rb +14 -0
  82. data/lib/devise/devise/token_generator.rb +70 -0
  83. data/lib/devise/devise/version.rb +3 -0
  84. data/lib/devise/generators/active_record/devise_generator.rb +73 -0
  85. data/lib/devise/generators/active_record/templates/migration.rb +18 -0
  86. data/lib/devise/generators/active_record/templates/migration_existing.rb +25 -0
  87. data/lib/devise/generators/devise/devise_generator.rb +26 -0
  88. data/lib/devise/generators/devise/install_generator.rb +29 -0
  89. data/lib/devise/generators/devise/orm_helpers.rb +51 -0
  90. data/lib/devise/generators/devise/views_generator.rb +135 -0
  91. data/lib/devise/generators/mongoid/devise_generator.rb +55 -0
  92. data/lib/devise/generators/templates/README +35 -0
  93. data/lib/devise/generators/templates/devise.rb +260 -0
  94. data/lib/devise/generators/templates/markerb/confirmation_instructions.markerb +5 -0
  95. data/lib/devise/generators/templates/markerb/reset_password_instructions.markerb +8 -0
  96. data/lib/devise/generators/templates/markerb/unlock_instructions.markerb +7 -0
  97. data/lib/devise/generators/templates/simple_form_for/confirmations/new.html.erb +16 -0
  98. data/lib/devise/generators/templates/simple_form_for/passwords/edit.html.erb +19 -0
  99. data/lib/devise/generators/templates/simple_form_for/passwords/new.html.erb +15 -0
  100. data/lib/devise/generators/templates/simple_form_for/registrations/edit.html.erb +27 -0
  101. data/lib/devise/generators/templates/simple_form_for/registrations/new.html.erb +17 -0
  102. data/lib/devise/generators/templates/simple_form_for/sessions/new.html.erb +15 -0
  103. data/lib/devise/generators/templates/simple_form_for/unlocks/new.html.erb +16 -0
  104. metadata +250 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 426c95252a65453936c976de7047b2d4976eef5a
4
+ data.tar.gz: 8c9e36163c2138ff8be1d04d426127ac290a45ea
5
+ SHA512:
6
+ metadata.gz: 8bd116136c7fac55cab58d454175b0181aa7450688e6534b1aed30ef277b9af3f3c3df9727419aa175d10f000c7f0c1dd665bd48090c4e66a700908f47b18a12
7
+ data.tar.gz: 4c629dbfe3dfa5f6c849e1e5393e14cd6cd4e98b5d593018b8d94a6b96f2051d0264eb418ea01649d318864c4f83ad8c2c18c31dd28af2a10dd14b99c24e00f0
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,31 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in devise-bootstrap.gemspec
4
+ gemspec
5
+
6
+ gem "rails", "~> 4.0.0"
7
+ gem "omniauth", "~> 1.0.0"
8
+ gem "omniauth-oauth2", "~> 1.0.0"
9
+ gem "rdoc"
10
+
11
+ group :test do
12
+ gem "omniauth-facebook"
13
+ gem "omniauth-openid", "~> 1.0.1"
14
+ gem "webrat", "0.7.3", require: false
15
+ gem "mocha", "~> 1.0.0", require: false
16
+ end
17
+
18
+ platforms :jruby do
19
+ gem "activerecord-jdbc-adapter"
20
+ gem "activerecord-jdbcsqlite3-adapter"
21
+ gem "jruby-openssl"
22
+ end
23
+
24
+ platforms :ruby do
25
+ gem "sqlite3"
26
+ end
27
+
28
+ group :mongoid do
29
+ gem "mongoid", github: "mongoid/mongoid", branch: "master"
30
+ end
31
+
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 ratnakar
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Devise::Bootstrap
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'devise-bootstrap'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install devise-bootstrap
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,47 @@
1
+ class Devise::ConfirmationsController < DeviseController
2
+ # GET /resource/confirmation/new
3
+ def new
4
+ self.resource = resource_class.new
5
+ end
6
+
7
+ # POST /resource/confirmation
8
+ def create
9
+ self.resource = resource_class.send_confirmation_instructions(resource_params)
10
+ yield resource if block_given?
11
+
12
+ if successfully_sent?(resource)
13
+ respond_with({}, location: after_resending_confirmation_instructions_path_for(resource_name))
14
+ else
15
+ respond_with(resource)
16
+ end
17
+ end
18
+
19
+ # GET /resource/confirmation?confirmation_token=abcdef
20
+ def show
21
+ self.resource = resource_class.confirm_by_token(params[:confirmation_token])
22
+ yield resource if block_given?
23
+
24
+ if resource.errors.empty?
25
+ set_flash_message(:notice, :confirmed) if is_flashing_format?
26
+ respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource) }
27
+ else
28
+ respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new }
29
+ end
30
+ end
31
+
32
+ protected
33
+
34
+ # The path used after resending confirmation instructions.
35
+ def after_resending_confirmation_instructions_path_for(resource_name)
36
+ new_session_path(resource_name) if is_navigational_format?
37
+ end
38
+
39
+ # The path used after confirmation.
40
+ def after_confirmation_path_for(resource_name, resource)
41
+ if signed_in?
42
+ signed_in_root_path(resource)
43
+ else
44
+ new_session_path(resource_name)
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,30 @@
1
+ class Devise::OmniauthCallbacksController < DeviseController
2
+ prepend_before_filter { request.env["devise.skip_timeout"] = true }
3
+
4
+ def passthru
5
+ render status: 404, text: "Not found. Authentication passthru."
6
+ end
7
+
8
+ def failure
9
+ set_flash_message :alert, :failure, kind: OmniAuth::Utils.camelize(failed_strategy.name), reason: failure_message
10
+ redirect_to after_omniauth_failure_path_for(resource_name)
11
+ end
12
+
13
+ protected
14
+
15
+ def failed_strategy
16
+ env["omniauth.error.strategy"]
17
+ end
18
+
19
+ def failure_message
20
+ exception = env["omniauth.error"]
21
+ error = exception.error_reason if exception.respond_to?(:error_reason)
22
+ error ||= exception.error if exception.respond_to?(:error)
23
+ error ||= env["omniauth.error.type"].to_s
24
+ error.to_s.humanize if error
25
+ end
26
+
27
+ def after_omniauth_failure_path_for(scope)
28
+ new_session_path(scope)
29
+ end
30
+ end
@@ -0,0 +1,70 @@
1
+ class Devise::PasswordsController < DeviseController
2
+ prepend_before_filter :require_no_authentication
3
+ # Render the #edit only if coming from a reset password email link
4
+ append_before_filter :assert_reset_token_passed, only: :edit
5
+
6
+ # GET /resource/password/new
7
+ def new
8
+ self.resource = resource_class.new
9
+ end
10
+
11
+ # POST /resource/password
12
+ def create
13
+ self.resource = resource_class.send_reset_password_instructions(resource_params)
14
+ yield resource if block_given?
15
+
16
+ if successfully_sent?(resource)
17
+ respond_with({}, location: after_sending_reset_password_instructions_path_for(resource_name))
18
+ else
19
+ respond_with(resource)
20
+ end
21
+ end
22
+
23
+ # GET /resource/password/edit?reset_password_token=abcdef
24
+ def edit
25
+ self.resource = resource_class.new
26
+ resource.reset_password_token = params[:reset_password_token]
27
+ end
28
+
29
+ # PUT /resource/password
30
+ def update
31
+ self.resource = resource_class.reset_password_by_token(resource_params)
32
+ yield resource if block_given?
33
+
34
+ if resource.errors.empty?
35
+ resource.unlock_access! if unlockable?(resource)
36
+ flash_message = resource.active_for_authentication? ? :updated : :updated_not_active
37
+ set_flash_message(:notice, flash_message) if is_flashing_format?
38
+ sign_in(resource_name, resource)
39
+ respond_with resource, location: after_resetting_password_path_for(resource)
40
+ else
41
+ respond_with resource
42
+ end
43
+ end
44
+
45
+ protected
46
+ def after_resetting_password_path_for(resource)
47
+ after_sign_in_path_for(resource)
48
+ end
49
+
50
+ # The path used after sending reset password instructions
51
+ def after_sending_reset_password_instructions_path_for(resource_name)
52
+ new_session_path(resource_name) if is_navigational_format?
53
+ end
54
+
55
+ # Check if a reset_password_token is provided in the request
56
+ def assert_reset_token_passed
57
+ if params[:reset_password_token].blank?
58
+ set_flash_message(:alert, :no_token)
59
+ redirect_to new_session_path(resource_name)
60
+ end
61
+ end
62
+
63
+ # Check if proper Lockable module methods are present & unlock strategy
64
+ # allows to unlock resource on password reset
65
+ def unlockable?(resource)
66
+ resource.respond_to?(:unlock_access!) &&
67
+ resource.respond_to?(:unlock_strategy_enabled?) &&
68
+ resource.unlock_strategy_enabled?(:email)
69
+ end
70
+ end
@@ -0,0 +1,137 @@
1
+ class Devise::RegistrationsController < DeviseController
2
+ prepend_before_filter :require_no_authentication, only: [ :new, :create, :cancel ]
3
+ prepend_before_filter :authenticate_scope!, only: [:edit, :update, :destroy]
4
+
5
+ # GET /resource/sign_up
6
+ def new
7
+ build_resource({})
8
+ respond_with self.resource
9
+ end
10
+
11
+ # POST /resource
12
+ def create
13
+ build_resource(sign_up_params)
14
+
15
+ resource_saved = resource.save
16
+ yield resource if block_given?
17
+ if resource_saved
18
+ if resource.active_for_authentication?
19
+ set_flash_message :notice, :signed_up if is_flashing_format?
20
+ sign_up(resource_name, resource)
21
+ respond_with resource, location: after_sign_up_path_for(resource)
22
+ else
23
+ set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_flashing_format?
24
+ expire_data_after_sign_in!
25
+ respond_with resource, location: after_inactive_sign_up_path_for(resource)
26
+ end
27
+ else
28
+ clean_up_passwords resource
29
+ respond_with resource
30
+ end
31
+ end
32
+
33
+ # GET /resource/edit
34
+ def edit
35
+ render :edit
36
+ end
37
+
38
+ # PUT /resource
39
+ # We need to use a copy of the resource because we don't want to change
40
+ # the current user in place.
41
+ def update
42
+ self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key)
43
+ prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email)
44
+
45
+ resource_updated = update_resource(resource, account_update_params)
46
+ yield resource if block_given?
47
+ if resource_updated
48
+ if is_flashing_format?
49
+ flash_key = update_needs_confirmation?(resource, prev_unconfirmed_email) ?
50
+ :update_needs_confirmation : :updated
51
+ set_flash_message :notice, flash_key
52
+ end
53
+ sign_in resource_name, resource, bypass: true
54
+ respond_with resource, location: after_update_path_for(resource)
55
+ else
56
+ clean_up_passwords resource
57
+ respond_with resource
58
+ end
59
+ end
60
+
61
+ # DELETE /resource
62
+ def destroy
63
+ resource.destroy
64
+ Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)
65
+ set_flash_message :notice, :destroyed if is_flashing_format?
66
+ yield resource if block_given?
67
+ respond_with_navigational(resource){ redirect_to after_sign_out_path_for(resource_name) }
68
+ end
69
+
70
+ # GET /resource/cancel
71
+ # Forces the session data which is usually expired after sign
72
+ # in to be expired now. This is useful if the user wants to
73
+ # cancel oauth signing in/up in the middle of the process,
74
+ # removing all OAuth session data.
75
+ def cancel
76
+ expire_data_after_sign_in!
77
+ redirect_to new_registration_path(resource_name)
78
+ end
79
+
80
+ protected
81
+
82
+ def update_needs_confirmation?(resource, previous)
83
+ resource.respond_to?(:pending_reconfirmation?) &&
84
+ resource.pending_reconfirmation? &&
85
+ previous != resource.unconfirmed_email
86
+ end
87
+
88
+ # By default we want to require a password checks on update.
89
+ # You can overwrite this method in your own RegistrationsController.
90
+ def update_resource(resource, params)
91
+ resource.update_with_password(params)
92
+ end
93
+
94
+ # Build a devise resource passing in the session. Useful to move
95
+ # temporary session data to the newly created user.
96
+ def build_resource(hash=nil)
97
+ self.resource = resource_class.new_with_session(hash || {}, session)
98
+ end
99
+
100
+ # Signs in a user on sign up. You can overwrite this method in your own
101
+ # RegistrationsController.
102
+ def sign_up(resource_name, resource)
103
+ sign_in(resource_name, resource)
104
+ end
105
+
106
+ # The path used after sign up. You need to overwrite this method
107
+ # in your own RegistrationsController.
108
+ def after_sign_up_path_for(resource)
109
+ after_sign_in_path_for(resource)
110
+ end
111
+
112
+ # The path used after sign up for inactive accounts. You need to overwrite
113
+ # this method in your own RegistrationsController.
114
+ def after_inactive_sign_up_path_for(resource)
115
+ respond_to?(:root_path) ? root_path : "/"
116
+ end
117
+
118
+ # The default url to be used after updating a resource. You need to overwrite
119
+ # this method in your own RegistrationsController.
120
+ def after_update_path_for(resource)
121
+ signed_in_root_path(resource)
122
+ end
123
+
124
+ # Authenticates the current scope and gets the current resource from the session.
125
+ def authenticate_scope!
126
+ send(:"authenticate_#{resource_name}!", force: true)
127
+ self.resource = send(:"current_#{resource_name}")
128
+ end
129
+
130
+ def sign_up_params
131
+ devise_parameter_sanitizer.sanitize(:sign_up)
132
+ end
133
+
134
+ def account_update_params
135
+ devise_parameter_sanitizer.sanitize(:account_update)
136
+ end
137
+ end
@@ -0,0 +1,53 @@
1
+ class Devise::SessionsController < DeviseController
2
+ prepend_before_filter :require_no_authentication, only: [ :new, :create ]
3
+ prepend_before_filter :allow_params_authentication!, only: :create
4
+ prepend_before_filter only: [ :create, :destroy ] { request.env["devise.skip_timeout"] = true }
5
+
6
+ # GET /resource/sign_in
7
+ def new
8
+ self.resource = resource_class.new(sign_in_params)
9
+ clean_up_passwords(resource)
10
+ respond_with(resource, serialize_options(resource))
11
+ end
12
+
13
+ # POST /resource/sign_in
14
+ def create
15
+ self.resource = warden.authenticate!(auth_options)
16
+ set_flash_message(:notice, :signed_in) if is_flashing_format?
17
+ sign_in(resource_name, resource)
18
+ yield resource if block_given?
19
+ respond_with resource, location: after_sign_in_path_for(resource)
20
+ end
21
+
22
+ # DELETE /resource/sign_out
23
+ def destroy
24
+ redirect_path = after_sign_out_path_for(resource_name)
25
+ signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
26
+ set_flash_message :notice, :signed_out if signed_out && is_flashing_format?
27
+ yield if block_given?
28
+
29
+ # We actually need to hardcode this as Rails default responder doesn't
30
+ # support returning empty response on GET request
31
+ respond_to do |format|
32
+ format.all { head :no_content }
33
+ format.any(*navigational_formats) { redirect_to redirect_path }
34
+ end
35
+ end
36
+
37
+ protected
38
+
39
+ def sign_in_params
40
+ devise_parameter_sanitizer.sanitize(:sign_in)
41
+ end
42
+
43
+ def serialize_options(resource)
44
+ methods = resource_class.authentication_keys.dup
45
+ methods = methods.keys if methods.is_a?(Hash)
46
+ methods << :password if resource.respond_to?(:password)
47
+ { methods: methods, only: [:password] }
48
+ end
49
+
50
+ def auth_options
51
+ { scope: resource_name, recall: "#{controller_path}#new" }
52
+ end
53
+ end