FEATURE: Trigger Discourse events from authenticators. (#7724)
This commit is contained in:
parent
d073a7d5a8
commit
a046f6ced5
|
@ -43,6 +43,7 @@ class Users::OmniauthCallbacksController < ApplicationController
|
|||
else
|
||||
@auth_result = authenticator.after_authenticate(auth)
|
||||
end
|
||||
DiscourseEvent.trigger(:after_auth, authenticator, @auth_result)
|
||||
|
||||
preferred_origin = request.env['omniauth.origin']
|
||||
|
||||
|
|
|
@ -1165,6 +1165,7 @@ class UsersController < ApplicationController
|
|||
|
||||
# We're likely going to contact the remote auth provider, so hijack request
|
||||
hijack do
|
||||
DiscourseEvent.trigger(:before_auth_revoke, authenticator, user)
|
||||
result = authenticator.revoke(user, skip_remote: skip_remote)
|
||||
if result
|
||||
render json: success_json
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Auth::Result
|
||||
attr_accessor :user, :name, :username, :email, :user,
|
||||
attr_accessor :user, :name, :username, :email,
|
||||
:email_valid, :extra_data, :awaiting_activation,
|
||||
:awaiting_approval, :authenticated, :authenticator_name,
|
||||
:requires_invite, :not_allowed_from_ip_address,
|
||||
|
|
Loading…
Reference in New Issue