13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/generators/authkit/templates/app/controllers/password_change_controller.rb', line 13
def create
if email_user.change_password(params[:password], params[:password_confirmation])
respond_to do |format|
format.json { head :no_content }
format.html {
flash.now[:notice] = "Password updated successfully"
redirect_to(login_path)
}
end
else
respond_to do |format|
format.json { render json: { status: 'error', errors: email_user.errors }.to_json, status: 422 }
format.html { render :show }
end
end
end
|