Class: Devise::PasswordExpiredController

Inherits:
DeviseController
  • Object
show all
Defined in:
app/controllers/devise/password_expired_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



9
10
11
# File 'app/controllers/devise/password_expired_controller.rb', line 9

def show
  respond_with(resource)
end

#updateObject

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
    set_flash_message :notice, :updated
     resource, scope: scope
    respond_with({}, location: stored_location_for(scope) || :root)
  else
    clean_up_passwords(resource)
    respond_with(resource, action: :show)
  end
end