mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
DEV: Introduce :before_auth
DiscourseEvent (#11233)
This is useful for plugins to manipulate the auth hash from OmniAuth before it is read by the Authenticator class
This commit is contained in:
@ -27,6 +27,7 @@ class Users::AssociateAccountsController < ApplicationController
|
||||
authenticator = Discourse.enabled_authenticators.find { |a| a.name == provider_name }
|
||||
raise Discourse::InvalidAccess.new(I18n.t('authenticator_not_found')) if authenticator.nil?
|
||||
|
||||
DiscourseEvent.trigger(:before_auth, authenticator, auth)
|
||||
auth_result = authenticator.after_authenticate(auth, existing_account: current_user)
|
||||
DiscourseEvent.trigger(:after_auth, authenticator, auth_result)
|
||||
|
||||
|
Reference in New Issue
Block a user