Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def changepass
- @user = current_user
- if(@user.provider != "email")
- flash[:notice] = "Invalid action"
- render :changepass
- else
- if request.post?
- if @user.update_with_password(:password => params[:password],:current_password => params[:current_password],:password_confirmation => params[:password_confirmation])
- # Sign in the user by passing validation in case their password changed
- sign_in @user, :bypass => true
- flash[:success] = "Password succesfuly changed"
- render :changepass, :success => true
- else
- render :changepass
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement