Skip to content

Commit

Permalink
fix(core): only show Twitter OAuth 2 warning once
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed Feb 2, 2022
1 parent a7d34f9 commit c9e16fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/lib/assert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ type ConfigError =
| MissingAuthorize
| MissingAdapter

let twitterWarned = false

/**
* Verify that the user configured `next-auth` correctly.
* Good place to mention deprecations as well.
Expand Down Expand Up @@ -78,7 +80,8 @@ export function assertConfig(
return new MissingAdapter("E-mail login requires an adapter.")
}

if (hasTwitterProvider) {
if (!twitterWarned && hasTwitterProvider) {
twitterWarned = true
return "TWITTER_OAUTH_2_BETA"
}
}

0 comments on commit c9e16fb

Please sign in to comment.