mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 06:51:27 +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:
@ -34,6 +34,7 @@ class Users::OmniauthCallbacksController < ApplicationController
|
||||
Discourse.redis.setex "#{Users::AssociateAccountsController::REDIS_PREFIX}_#{current_user.id}_#{token}", 10.minutes, auth.to_json
|
||||
return redirect_to "#{Discourse.base_path}/associate/#{token}"
|
||||
else
|
||||
DiscourseEvent.trigger(:before_auth, authenticator, auth)
|
||||
@auth_result = authenticator.after_authenticate(auth)
|
||||
DiscourseEvent.trigger(:after_auth, authenticator, @auth_result)
|
||||
end
|
||||
|
Reference in New Issue
Block a user