You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.
I wanted to add a logic to my app that gets triggered by authentication to certain scope.
I added a callback via Warden::Manager.after_set_user, but after_set_user callbacks never get triggered with :authentication event; I'm only seeing :fetch events.
It turned out that the first callback for after_set_user is this one (lib/warden/github/hook.rb) and it throws(:warden) in finalize_flow! which prematurely exits the entire stack of Warden::Proxy#authenticate! ⇒ Warden::Proxy#_perform_authentication ⇒ Warden::Proxy#set_user ⇒ Warden::Manager#_run_callbacks, most importantly skipping the rest of after_set_user callbacks in _run_callbacks.
Not sure if this is a bug or by design, but it would be nice to fix it or document/provide an alternative such that a process can be performed upon authentication (at the beginning of the session).
Right now, I'm using Warden::Manager.prepend_after_authentication to force my callback to come before the one above. It's not a very clean solution but probably an acceptable one if documented.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I wanted to add a logic to my app that gets triggered by authentication to certain scope.
I added a callback via
Warden::Manager.after_set_user
, butafter_set_user
callbacks never get triggered with:authentication
event; I'm only seeing:fetch
events.It turned out that the first callback for
after_set_user
is this one (lib/warden/github/hook.rb) and itthrows(:warden)
infinalize_flow!
which prematurely exits the entire stack ofWarden::Proxy#authenticate!
⇒Warden::Proxy#_perform_authentication
⇒Warden::Proxy#set_user
⇒Warden::Manager#_run_callbacks
, most importantly skipping the rest ofafter_set_user
callbacks in_run_callbacks
.Not sure if this is a bug or by design, but it would be nice to fix it or document/provide an alternative such that a process can be performed upon authentication (at the beginning of the session).
Right now, I'm using
Warden::Manager.prepend_after_authentication
to force my callback to come before the one above. It's not a very clean solution but probably an acceptable one if documented.The text was updated successfully, but these errors were encountered: