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 response object access to Express & Koa authentication middlewares #1557

Merged

Conversation

iffa
Copy link
Contributor

@iffa iffa commented Feb 7, 2024

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you written unit tests?
  • Have you written unit tests that cover the negative cases (i.e.: if bad data is submitted, does the library respond properly)?
  • This PR is associated with an existing issue?

Closing issues

Closes #1145

If this is a new feature submission:

  • Has the issue had a maintainer respond to the issue and clarify that the feature is something that aligns with the goals and philosophy of the project?

See labels on issue.

Potential Problems With The Approach

I don't exactly like the fact that the response is added as the last argument to the middlewares, but this was done for the sake of backwards-compatibility.

Hapi was left out since I had a really difficult time understanding the inner workings of said library.

Test plan

Basic test cases added that confirm that when the response is modified in the authentication middleware, changes persist to the actual response.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello there iffa 👋

Thank you and congrats 🎉 for opening your first PR on this project.✨

We will review the following PR soon! 👀

@iffa
Copy link
Contributor Author

iffa commented Feb 7, 2024

Seems test run fails are not related to changes in this PR

@WoH WoH merged commit e6dc38e into lukeautry:master Feb 13, 2024
19 checks passed
@WoH
Copy link
Collaborator

WoH commented Feb 13, 2024

LGTM, thanks!

@iffa iffa deleted the feat/add-response-arg-to-authentication-middlewares branch February 15, 2024 12:29
louis-amhild pushed a commit to louis-amhild/tsoa-deno that referenced this pull request Mar 1, 2024
…lewares (lukeautry#1557)

* feat: add response argument to authentication middlewares

* Rollback hapi changes, add basic tests

* Remove redundant logic

* Support sending custom response
louis-amhild pushed a commit to louis-amhild/tsoa-deno that referenced this pull request Mar 9, 2024
…lewares (lukeautry#1557)

* feat: add response argument to authentication middlewares

* Rollback hapi changes, add basic tests

* Remove redundant logic

* Support sending custom response
louis-amhild pushed a commit to louis-amhild/tsoa-deno that referenced this pull request Mar 10, 2024
…lewares (lukeautry#1557)

* feat: add response argument to authentication middlewares

* Rollback hapi changes, add basic tests

* Remove redundant logic

* Support sending custom response
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.

Can't access response in authentication function
2 participants