mirror of
https://github.com/discourse/discourse.git
synced 2025-03-25 17:36:53 +08:00
FIX: Ensure :after_auth event is triggered. (#7791)
This commit is contained in:
parent
02f6db4e59
commit
ee8669d778
@ -32,9 +32,11 @@ class Users::OmniauthCallbacksController < ApplicationController
|
|||||||
@auth_result = authenticator.after_authenticate(auth, existing_account: current_user)
|
@auth_result = authenticator.after_authenticate(auth, existing_account: current_user)
|
||||||
if provider&.full_screen_login || cookies['fsl']
|
if provider&.full_screen_login || cookies['fsl']
|
||||||
cookies.delete('fsl')
|
cookies.delete('fsl')
|
||||||
|
DiscourseEvent.trigger(:after_auth, authenticator, @auth_result)
|
||||||
return redirect_to Discourse.base_uri("/my/preferences/account")
|
return redirect_to Discourse.base_uri("/my/preferences/account")
|
||||||
else
|
else
|
||||||
@auth_result.authenticated = true
|
@auth_result.authenticated = true
|
||||||
|
DiscourseEvent.trigger(:after_auth, authenticator, @auth_result)
|
||||||
return respond_to do |format|
|
return respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.json { render json: @auth_result.to_client_hash }
|
format.json { render json: @auth_result.to_client_hash }
|
||||||
@ -42,8 +44,8 @@ class Users::OmniauthCallbacksController < ApplicationController
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
@auth_result = authenticator.after_authenticate(auth)
|
@auth_result = authenticator.after_authenticate(auth)
|
||||||
|
DiscourseEvent.trigger(:after_auth, authenticator, @auth_result)
|
||||||
end
|
end
|
||||||
DiscourseEvent.trigger(:after_auth, authenticator, @auth_result)
|
|
||||||
|
|
||||||
preferred_origin = request.env['omniauth.origin']
|
preferred_origin = request.env['omniauth.origin']
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user