New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add #{before,after}_successful_authorization hooks in Doorkeeper::TokensController #1264
Add #{before,after}_successful_authorization hooks in Doorkeeper::TokensController #1264
Conversation
98b1d93
to
39eaf84
Compare
39eaf84
to
dce200e
Compare
Actually I'm thinking about how valid is this hook here. Initially |
I guess I need to explain the use case: similar to The Would adding different hooks (e.g. |
Hi @fotos . Need to think a little bit more about it. Seems like any other grant flow also must have such hooks and it's also an authorization process, but something confuses me ... Maybe we can find an author of the original PR introduced this hooks and asked him why this hooks works as they works? I don't remember, maybe it was @f3ndot (sorry if I'm wrong, I remember you refactored or introduced this configuration options). |
👋 @nbulaj. No worries, although I'd love to get this merged there is no rush. I linked to the PRs that introduced the feature in the description (summary). The authors that introduced the callbacks were @nattfodd and @mdeutsch (both PRs have been merged by you 🙌).
I lost you here. You mean other flows should have such hooks and they are currently missing them or other flows have such hooks already (except the In any case let me know if I can help, in any way, to get this landed! 🛬 |
this one 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚝
I thought about how valid is to reuse this callbacks for tokens controller (that controls password / client credentials / etc flows) and seems like it's OK for me. We are doing an authorization for any grant flow, so we must support all of them
Thanks @nbulaj! Is there anything else that needs to be changed or shall I squash the commits and then you can merge? 🚀 |
Yep, squash them and I think it's ready for merging. Sorry, I'm very busy right now, can't find much time for open-source |
dce200e
to
aa2e7ce
Compare
@nbulaj commits squashed. 🗜 No worries, I'm used to waiting weeks or sometimes even months. 😁 A single day turnaround is pretty cool in my book. 😎 |
Thanks, @fotos , for your work! ❤️ |
Summary
Added
#{before,after}_successful_authorization
hooks inDoorkeeper::TokensController#create
, similar to #1064, as amended in #1075).Other Information
For the
#before_successful_authorization
I am not sure how to (pre) authorize likeDoorkeeper::AuthorizationsController#pre_auth
.The
pre_auth.authorizable?
seems to contradict the hook name. If the#pre_auth
is#authorizable?
does it mean that the strategy is going to be successful? 🤔In any case I decided to keep the names the same. I would appreciate some feedback or a pointer towards the right direction.
Additionally I added specs for
Doorkeeper::TokensController#create
. For some reason they have been disabled in 7f54ac2.