修改密码完成后跳到个人资料
This commit is contained in:
parent
297cb9182e
commit
9ba55296f5
|
@ -202,31 +202,18 @@ class MyController < ApplicationController
|
||||||
flash.now[:notice] = l(:notice_account_password_updated)
|
flash.now[:notice] = l(:notice_account_password_updated)
|
||||||
# 修改完密码,让其重新登录,并更新Token
|
# 修改完密码,让其重新登录,并更新Token
|
||||||
Token.delete_user_all_tokens(@user)
|
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
|
||||||
end
|
end
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
if e.message == 'wrong password'
|
if e.message == 'wrong password'
|
||||||
flash.now[:error] = l(:notice_account_wrong_password)
|
flash.now[:error] = l(:notice_account_wrong_password)
|
||||||
|
else
|
||||||
|
flash.now[:error] = e.message
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
# Create a new feeds key
|
# Create a new feeds key
|
||||||
|
|
Loading…
Reference in New Issue