Skip to content
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 request token event #49

Merged
merged 1 commit into from
Oct 5, 2021
Merged

Conversation

jr-k
Copy link
Contributor

@jr-k jr-k commented Sep 27, 2021

I've added an event to manipulate the response during /token process. Useful to add some Set-Cookie directives for example.

Copy link
Contributor

@mtarld mtarld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jr-k!

Thanks for your PR 🙂

Could you add some unit tests as well?
Moreover, there are some unneeded blank lines that must be removed in order to follow the current coding standards

@jr-k
Copy link
Contributor Author

jr-k commented Sep 29, 2021

Some what ? Never heard of "tests". Joke aside, I'm not very good nor familiar at writing tests (Shame on me).

Here is a commit for blank lines.

@chalasr
Copy link
Member

chalasr commented Sep 29, 2021

@jr-k Time to level up then? :)

Jokes aside, thanks for the PR.
If you are wiling to write that test (which will be required for merging anyway), you can probably copy an existing case in TokenEndpointTest. Some events close to the one you are introducing are tested there.

Also, some code quality checks of our CI are broken with this change.
Can you check the failing jobs in the CI? Their output should give you enough info to fix them.

@jr-k
Copy link
Contributor Author

jr-k commented Sep 30, 2021

Here we are, no conflicts and tests, alright ?

Copy link
Member

@chalasr chalasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect 👌

@jr-k
Copy link
Contributor Author

jr-k commented Oct 4, 2021

Is there a merge date policy ? I need this in production, I can use my fork but I would like to avoid that.

@chalasr chalasr force-pushed the response_listener branch from d5f8c6b to 7be39ea Compare October 5, 2021 13:28
@chalasr
Copy link
Member

chalasr commented Oct 5, 2021

Thank you @jr-k.

@chalasr chalasr merged commit df405a8 into thephpleague:master Oct 5, 2021
@chalasr
Copy link
Member

chalasr commented Oct 5, 2021

@ajgarlag ajgarlag mentioned this pull request Oct 5, 2021
chalasr added a commit that referenced this pull request Oct 7, 2021
This PR was squashed before being merged into the 0.1-dev branch.

Discussion
----------

Fix request token event

I think #49 was merged too soon.

This PR tries to fix the following flaws:

  1. The test expectation is wrong.
  2. The event listener in the test is being added after the event dispatch.
  3. The response set to the event is being discarded by the controller.

Commits
-------

f14c02d Fix request token event
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants