mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 14:22:40 +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:
@ -196,6 +196,7 @@ RSpec.describe Users::OmniauthCallbacksController do
|
||||
Rails.application.env_config["omniauth.origin"] = destination_url
|
||||
|
||||
events = DiscourseEvent.track_events { get "/auth/google_oauth2/callback.json" }
|
||||
expect(events.any? { |e| e[:event_name] == :before_auth }).to eq(true)
|
||||
expect(events.any? { |e| e[:event_name] === :after_auth && Auth::GoogleOAuth2Authenticator === e[:params][0] && !e[:params][1].failed? }).to eq(true)
|
||||
|
||||
expect(response.status).to eq(302)
|
||||
|
Reference in New Issue
Block a user