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

refactor: make pkce option a client setting #646

Merged
merged 12 commits into from
Apr 10, 2023
Merged

Conversation

J0
Copy link
Contributor

@J0 J0 commented Apr 5, 2023

Refactor pkce to be a client setting so it doesn't have to be configured on invocation for each method.

  • also call exchangeSessionForCode in the background if detectSession is enabled
  • also remove the flowType option from signInWithOAuth

@J0 J0 marked this pull request as ready for review April 7, 2023 13:29
Copy link
Member

@thorwebdev thorwebdev left a comment

Choose a reason for hiding this comment

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

One storage naming issue in _isPKCEFlow otherwise LGTM, thanks.

private async _isPKCEFlow(): Promise<boolean> {
const currentStorageContent = await getItemAsync(
this.storage,
`${this.storageKey}-code-verifier`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`${this.storageKey}-code-verifier`
`${this.storageKey}-oauth-code-verifier`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, good catch! Have renamed everything else to code-verifier instead so as to keep it generic

@J0
Copy link
Contributor Author

J0 commented Apr 10, 2023

Leaving this with a refactor: prefix so semver doesn't trigger another release as I'd like to get another three PRs in

  1. remove OAuth flowType param
  2. add magic link binding
  3. add recover bindings
    Before making another release

Upd: looks like refactor triggers a release too

@J0 J0 merged commit 461d03b into master Apr 10, 2023
1 check passed
@J0 J0 deleted the j0/add_global_pkce_option branch April 10, 2023 02:39
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.20.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

2 participants