mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 03:10:46 -06:00
Revert "FIX: redirect to sso_destination_url after account activation"
This reverts commit 0402e97368
.
This commit is contained in:
parent
0402e97368
commit
abda21a41f
@ -77,7 +77,6 @@ class SessionController < ApplicationController
|
||||
end
|
||||
else
|
||||
session[:sso_payload] = request.query_string
|
||||
cookies[:sso_destination_url] = sso.to_url(sso.return_sso_url)
|
||||
redirect_to path('/login')
|
||||
end
|
||||
else
|
||||
|
@ -667,10 +667,13 @@ class UsersController < ApplicationController
|
||||
|
||||
@custom_body_class = "static-account-created"
|
||||
@message = session['user_created_message'] || I18n.t('activation.missing_session')
|
||||
@account_created = { message: @message, show_controls: false }
|
||||
@account_created = {
|
||||
message: @message,
|
||||
show_controls: false
|
||||
}
|
||||
|
||||
if session_user_id = session[SessionController::ACTIVATE_USER_KEY]
|
||||
if user = User.find_by(id: session_user_id.to_i)
|
||||
if user = User.where(id: session_user_id.to_i).first
|
||||
@account_created[:username] = user.username
|
||||
@account_created[:email] = user.email
|
||||
@account_created[:show_controls] = !user.from_staged?
|
||||
@ -693,8 +696,8 @@ class UsersController < ApplicationController
|
||||
|
||||
def perform_account_activation
|
||||
raise Discourse::InvalidAccess.new if honeypot_or_challenge_fails?(params)
|
||||
|
||||
if @user = EmailToken.confirm(params[:token])
|
||||
|
||||
# Log in the user unless they need to be approved
|
||||
if Guardian.new(@user).can_access_forum?
|
||||
@user.enqueue_welcome_message('welcome_user') if @user.send_welcome_message
|
||||
@ -705,9 +708,6 @@ class UsersController < ApplicationController
|
||||
elsif destination_url = cookies[:destination_url]
|
||||
cookies[:destination_url] = nil
|
||||
return redirect_to(destination_url)
|
||||
elsif sso_destination_url = cookies[:sso_destination_url]
|
||||
cookies[:sso_destination_url] = nil
|
||||
return redirect_to(sso_destination_url)
|
||||
end
|
||||
else
|
||||
@needs_approval = true
|
||||
|
Loading…
Reference in New Issue
Block a user