mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
clean up implementation of non frame login / registration
This commit is contained in:
@ -33,6 +33,7 @@ class Users::OmniauthCallbacksController < ApplicationController
|
||||
auth[:session] = session
|
||||
|
||||
authenticator = self.class.find_authenticator(params[:provider])
|
||||
provider = Discourse.auth_providers && Discourse.auth_providers.find{|p| p.name == params[:provider]}
|
||||
|
||||
@auth_result = authenticator.after_authenticate(auth)
|
||||
|
||||
@ -54,9 +55,15 @@ class Users::OmniauthCallbacksController < ApplicationController
|
||||
else
|
||||
@auth_result.authenticator_name = authenticator.name
|
||||
complete_response_data
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render json: @auth_result.to_client_hash }
|
||||
|
||||
if provider && provider.full_screen_login
|
||||
flash[: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
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user