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: rename protection to checks #2255

Merged
merged 5 commits into from
Jul 10, 2021
Merged

Conversation

balazsorban44
Copy link
Member

@balazsorban44 balazsorban44 commented Jun 25, 2021

This will better align with openid-client's checks https://github.com/panva/node-openid-client/blob/main/docs/README.md#clientcallbackredirecturi-parameters-checks-extras, a library which we intend to migrate to in the future. Aligning our API early, so people get used to it.

Also, objectively the name protection might not have been as clear as I first thought. checks better describes the intention.

BREAKING CHANGE:

The state option on OAuth providers is now deprecated. Use checks: ["state"] instead.
protections is renamed to checks, here is an example:

- protection: ["pkce"]
+ checks: ["pkece"]

Furthermore, string values are not supported anymore. This is to be able to handle fewer cases internally.

- checks: "state"
+ checks: ["state"]

@vercel
Copy link

vercel bot commented Jun 25, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nextauthjs/next-auth/HhbvagDhw81s3QHKCfbeamzwJ562
✅ Preview: https://next-auth-git-feat-simplify-protection-nextauthjs.vercel.app

@github-actions github-actions bot added core Refers to `@auth/core` docs Relates to documentation providers TypeScript Issues relating to TypeScript labels Jun 25, 2021
@vercel vercel bot temporarily deployed to Preview July 2, 2021 19:09 Inactive
@codecov-commenter
Copy link

codecov-commenter commented Jul 2, 2021

Codecov Report

Merging #2255 (fadc863) into next (cff153b) will increase coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #2255      +/-   ##
==========================================
+ Coverage   10.74%   10.78%   +0.03%     
==========================================
  Files          83       83              
  Lines        1414     1409       -5     
  Branches      393      389       -4     
==========================================
  Hits          152      152              
  Misses       1042     1042              
+ Partials      220      215       -5     
Impacted Files Coverage Δ
src/providers/apple.js 0.00% <ø> (ø)
src/providers/dropbox.js 0.00% <ø> (ø)
src/providers/naver.js 0.00% <ø> (ø)
src/providers/salesforce.js 0.00% <ø> (ø)
src/server/index.js 0.00% <0.00%> (ø)
src/server/lib/oauth/client.js 0.00% <0.00%> (ø)
src/server/lib/oauth/pkce-handler.js 0.00% <0.00%> (ø)
src/server/lib/oauth/state-handler.js 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cff153b...fadc863. Read the comment docs.

Copy link
Member

@ndom91 ndom91 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Collaborator

@ubbe-xyz ubbe-xyz left a comment

Choose a reason for hiding this comment

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

Nice 💚

@vercel vercel bot temporarily deployed to Preview July 8, 2021 18:07 Inactive
@vercel vercel bot temporarily deployed to Preview July 10, 2021 21:53 Inactive
@balazsorban44 balazsorban44 merged commit 6911dd9 into next Jul 10, 2021
@balazsorban44 balazsorban44 deleted the feat/simplify-protection branch July 10, 2021 21:55
mnphpexpert added a commit to mnphpexpert/next-auth that referenced this pull request Sep 2, 2024
This change aligns the API with `openid-client`'s `checks` https://github.com/panva/node-openid-client/blob/main/docs/README.md#clientcallbackredirecturi-parameters-checks-extras, a library which we intend to migrate to in the future. Aligning our API early, so people get used to it.

Also, objectively the name `protection` might not have been as clear as I first thought. `checks` better describe the intention.

BREAKING CHANGE:

The `state` option on OAuth providers is now deprecated. Use `checks: ["state"]` instead.
`protections` is renamed to `checks`, here is an example:
```diff
- protection: ["pkce"]
+ checks: ["pkece"]
```

Furthermore, string values are not supported anymore. This is to be able to handle fewer cases internally.
```diff
- checks: "state"
+ checks: ["state"]
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core` docs Relates to documentation providers TypeScript Issues relating to TypeScript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants