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

Feat: add WithRequest as a type and the callback #26

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bote795
Copy link

@bote795 bote795 commented Jun 15, 2024

Add ability to pass the request to the verification function this allows the user to connect a currently loggined in user to w/e auth provider they are trying to login

  • Still needs to be tested.
    Will be tested after learning how to test

notes:

@bote795
Copy link
Author

bote795 commented Jun 21, 2024

@thgh how do you usually test this? would I do a yarn link?

extends BaseOAuthPluginOptions,
StrategyOptionsWithRequest {
/**
* With this option enabled, req will be passed as the first argument to the verify callback.
Copy link
Owner

Choose a reason for hiding this comment

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

How about always passing the request as last argument to the verify callback?

@thgh
Copy link
Owner

thgh commented Jun 26, 2024

I'm not using this package as my needs changed over time 🥲

Ideally, there would be a vitest integration test that spawns an http server and simulates the oauth flow.

@thgh
Copy link
Owner

thgh commented Jun 27, 2024

@bote795
Copy link
Author

bote795 commented Jun 28, 2024

Check out this test 🙌 https://github.com/thgh/payload-plugin-oauth/blob/main/test/integration.test.ts

thanks, ill check it out! need to get some time to do this

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.

2 participants