From 9ba55296f59f37d2f07389e130484cc9cd283826 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 6 May 2015 15:17:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=90=8E=E8=B7=B3=E5=88=B0=E4=B8=AA=E4=BA=BA=E8=B5=84?= =?UTF-8?q?=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/my_controller.rb | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 8c76da1a9..d4f98749a 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -202,31 +202,18 @@ class MyController < ApplicationController flash.now[:notice] = l(:notice_account_password_updated) # 修改完密码,让其重新登录,并更新Token Token.delete_user_all_tokens(@user) - redirect_to logout_url + logout_user + redirect_to signin_url(back_url: my_account_path) + else + flash.now[:error] = l(:notice_account_wrong_password) end end rescue Exception => e if e.message == 'wrong password' flash.now[:error] = l(:notice_account_wrong_password) + else + flash.now[:error] = e.message end - # @user = User.current - # unless @user.change_password_allowed? - # flash.now[:error] = l(:notice_can_t_change_password) - # redirect_to my_account_url - # return - # end - # if request.post? - # if @user.check_password?(params[:password]) - # @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation] - # - # if @user.save - # flash.now[:notice] = l(:notice_account_password_updated) - # redirect_to my_account_url - # end - # else - # flash.now[:error] = l(:notice_account_wrong_password) - # end - # end end # Create a new feeds key