Skip to content

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

Draft
bote795 wants to merge 1 commit into
thgh:mainfrom
bote795:feature-reqCallback
Draft

Feat: add WithRequest as a type and the callback#26
bote795 wants to merge 1 commit into
thgh:mainfrom
bote795:feature-reqCallback

Conversation

@bote795

@bote795 bote795 commented Jun 15, 2024

Copy link
Copy Markdown

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

bote795 commented Jun 21, 2024

Copy link
Copy Markdown
Author

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

Comment thread src/types.ts
extends BaseOAuthPluginOptions,
StrategyOptionsWithRequest {
/**
* With this option enabled, req will be passed as the first argument to the verify callback.

Copy link
Copy Markdown
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

thgh commented Jun 26, 2024

Copy link
Copy Markdown
Owner

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

thgh commented Jun 27, 2024

Copy link
Copy Markdown
Owner

@bote795

bote795 commented Jun 28, 2024

Copy link
Copy Markdown
Author

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