12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/protected/sessions_controller.rb', line 12
def update_first_login
current_user.update_on_first_login!(params[:user])
if current_user.errors.any?
render :action => :first_login
else
sign_out_all_scopes
flash[:notice] = "Your password has been changed, please log in again."
redirect_to new_user_session_url
end
rescue PasswordAlreadyUsedException => e
current_user.errors.add(:password, e.message)
render :action => :first_login
rescue ActiveRecord::RecordInvalid => f
render :action => :first_login
end
|