Sha256: 6cc4fd129d2ec336115dffd41ee72652e5e63b6db7f4f8893c43c72a845bc6b6
Contents?: true
Size: 654 Bytes
Versions: 11
Compression:
Stored size: 654 Bytes
Contents
class ResetPasswordPortlet < Portlet def render flash[:reset_password] = {} unless params[:token] flash[:reset_password][:error] = "No password token given" return end @user = User.find_by_reset_token(params[:token]) unless @user flash[:reset_password][:notice] = "Invalid password token" return end if request.method == :post @user.password = params[:password] @user.password_confirmation = params[:password_confirmation] if @user.save flash[:reset_password][:notice] = 'Password has been reset' end end end end
Version data entries
11 entries across 11 versions & 4 rubygems