mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
FIX: bust broken password
This commit is contained in:
parent
e5fd2946e0
commit
3473734af0
@ -156,18 +156,14 @@ class UsersController < ApplicationController
|
||||
@user = EmailToken.confirm(params[:token])
|
||||
if @user.blank?
|
||||
flash[:error] = I18n.t('password_reset.no_token')
|
||||
else
|
||||
raise Discourse::InvalidParameters.new(:password) unless good_reset_request_format
|
||||
elsif request.put?
|
||||
raise Discourse::InvalidParameters.new(:password) unless params[:password].present?
|
||||
@user.password = params[:password]
|
||||
logon_after_password_reset if @user.save
|
||||
end
|
||||
render layout: 'no_js'
|
||||
end
|
||||
|
||||
def good_reset_request_format
|
||||
request.put? && params[:password].present?
|
||||
end
|
||||
|
||||
def logon_after_password_reset
|
||||
message = if Guardian.new(@user).can_access_forum?
|
||||
# Log in the user
|
||||
|
Loading…
Reference in New Issue
Block a user