app/controllers/devise/password_expired_controller.rb
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
      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
# Update the password stored on the `resource`.
# @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.
# @see https://stackoverflow.com/questions/228225/prevent-redirection-of-xmlhttprequest
# @see https://github.com/axios/axios/issues/932#issuecomment-307390761
# @see https://github.com/devise-security/devise-security/pull/111
Update the password stored on the `resource`.
Update the password stored on the ` resource ` .
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
      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
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 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
Update the password stored on the `resource`.
Update the password stored on the ` resource ` .
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.
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 .
see
None
see
None
see
None