mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Use full page redirection for all external auth methods (#8092)
Using popups is becoming increasingly rare. Full page redirects are already used on mobile, and for some providers. This commit removes all logic related to popup authentication, leaving only the full page redirect method. For more info, see https://meta.discourse.org/t/do-we-need-popups-for-login/127988
This commit is contained in:
@@ -724,9 +724,6 @@ class ApplicationController < ActionController::Base
|
||||
session[:destination_url] = destination_url
|
||||
redirect_to path('/session/sso')
|
||||
return
|
||||
elsif params[:authComplete].present?
|
||||
redirect_to path("/login?authComplete=true")
|
||||
return
|
||||
else
|
||||
# save original URL in a cookie (javascript redirects after login in this case)
|
||||
cookies[:destination_url] = destination_url
|
||||
|
||||
@@ -71,18 +71,9 @@ class Users::OmniauthCallbacksController < ApplicationController
|
||||
else
|
||||
@auth_result.authenticator_name = authenticator.name
|
||||
complete_response_data
|
||||
|
||||
if provider&.full_screen_login || cookies['fsl']
|
||||
cookies.delete('fsl')
|
||||
cookies['_bypass_cache'] = true
|
||||
cookies[:authentication_data] = @auth_result.to_client_hash.to_json
|
||||
redirect_to @origin
|
||||
else
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render json: @auth_result.to_client_hash }
|
||||
end
|
||||
end
|
||||
cookies['_bypass_cache'] = true
|
||||
cookies[:authentication_data] = @auth_result.to_client_hash.to_json
|
||||
redirect_to @origin
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user