Class: Devise::PasswordExpiredController
- Inherits:
-
DeviseController
- Object
- DeviseController
- Devise::PasswordExpiredController
- Defined in:
- app/controllers/devise/password_expired_controller.rb
Instance Method Summary collapse
-
#after_password_expired_update_path_for(_resource) ⇒ String, Symbol
Allows you to customize where the user is sent to after the update action successfully completes.
- #show ⇒ Object
-
#update ⇒ Object
Update the password stored on the ‘resource`.
Instance Method Details
#after_password_expired_update_path_for(_resource) ⇒ String, Symbol
Allows you to customize where the user is sent to after the update action successfully completes.
Defaults to the request’s original path, and then ‘root` if that is `nil`.
42 43 44 |
# File 'app/controllers/devise/password_expired_controller.rb', line 42 def after_password_expired_update_path_for(_resource) stored_location_for(scope) || :root end |
#show ⇒ Object
9 10 11 |
# File 'app/controllers/devise/password_expired_controller.rb', line 9 def show respond_with(resource) end |
#update ⇒ Object
Note:
if a common data format like :json or :xml are requested this will respond with a 204 No Content and set the Location header. Useful for dealing with APIs when JS clients would otherwise automatically follow the redirect, which can be problematic.
Update the password stored on the ‘resource`.
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/devise/password_expired_controller.rb', line 21 def update resource.extend(Devise::Models::DatabaseAuthenticatablePatch) if resource.update_with_password(resource_params) warden.session(scope)['password_expired'] = false :notice, :updated bypass_sign_in resource, scope: scope respond_with({}, location: after_password_expired_update_path_for(resource)) else clean_up_passwords(resource) respond_with(resource, action: :show) end end |