mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Pass the cookie jar to the :after_auth event (#13591)
Plugins can add custom cookies by hooking to this event. The auth result is also included in this event so they can know if auth was successful.
This commit is contained in:
@@ -27,9 +27,9 @@ 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)
|
||||
DiscourseEvent.trigger(:before_auth, authenticator, auth, session, cookies)
|
||||
auth_result = authenticator.after_authenticate(auth, existing_account: current_user)
|
||||
DiscourseEvent.trigger(:after_auth, authenticator, auth_result)
|
||||
DiscourseEvent.trigger(:after_auth, authenticator, auth_result, session, cookies)
|
||||
|
||||
render json: success_json
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user