Skip to content

Conversation

dominik-kropp
Copy link

Currently, adding state: true to the plugin options does not work and produces an error, even though the underlying passport strategy supports it.

This change makes it work.

@dominik-kropp dominik-kropp force-pushed the feature/support-state branch from 291ba05 to 46deb55 Compare August 1, 2024 13:00
@thgh
Copy link
Owner

thgh commented Aug 4, 2024

Could you add a test for this?
Around this line:

client_id: 'client_id',

@dominik-kropp
Copy link
Author

Not that trivial unfortunately. To test the authorize callback, the first call should go to the payload authorize API (not the oauth provider API) which then redirects to the OAuth provider and which should have the state parameter. For that to work, the callbackURL needs to be passed as a config option or the redirect_uri is not generated. And for that, the port needs to be known to the app -- not sure how to get that information when instantiating the payload server.

@thgh
Copy link
Owner

thgh commented Aug 10, 2024

Those should be in order already:

Payload url is this:

expect(app.url).toMatch(/http:\/\/localhost:\d+/)

oAuth authorize url is here:

AUTHORIZATION_URL: oauth.url + '/authorize',

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