A platform for community discussion. Free, open, simple.
FIX: Ensure :after_auth event is triggered. (#7791)
Dan Ungureanuee8669d778ad
diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rbindex d7473a51f6e..4a9b0916e2f 100644--- a/app/controllers/users/omniauth_callbacks_controller.rb+++ b/app/controllers/users/omniauth_callbacks_controller.rb@@ -32,9 +32,11 @@ class Users::OmniauthCallbacksController < ApplicationController@auth_result = authenticator.after_authenticate(auth, existing_account: current_user)if provider&.full_screen_login || cookies['fsl']cookies.delete('fsl')+ DiscourseEvent.trigger(:after_auth, authenticator, @auth_result)return redirect_to Discourse.base_uri("/my/preferences/account")else@auth_result.authenticated = true+ DiscourseEvent.trigger(:after_auth, authenticator, @auth_result)return respond_to do |format|format.htmlformat.json { render json: @auth_result.to_client_hash }@@ -42,8 +44,8 @@ class Users::OmniauthCallbacksController < ApplicationControllerendelse@auth_result = authenticator.after_authenticate(auth)+ DiscourseEvent.trigger(:after_auth, authenticator, @auth_result)end- DiscourseEvent.trigger(:after_auth, authenticator, @auth_result)preferred_origin = request.env['omniauth.origin']