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

Account linking does not work correctly when using JWT #625

Closed
2 of 5 tasks
RobertCraigie opened this issue Aug 31, 2020 · 7 comments
Closed
2 of 5 tasks

Account linking does not work correctly when using JWT #625

RobertCraigie opened this issue Aug 31, 2020 · 7 comments
Labels
bug Something isn't working help-needed The maintainer needs help due to time constraint/missing knowledge

Comments

@RobertCraigie
Copy link
Contributor

Describe the bug
Signing in with email and then signing in with an OAuth provider creates two separate users when using JWT sessions.

It should be noted that I only tested this issue with an OAuth provider that does not grant access to the user's email address

Steps to reproduce
https://github.com/RobertCraigie/next-auth-multiple-user-bug

  • Sign in with email
  • Sign in with Bungie

Expected behavior
One user is created and the OAuth account is linked to said user.

Screenshots or error logs
https://imgur.com/a/sI2pNzp

Additional context
I have traced the root cause of this issue to

if (session && session.user) {

This block of code expects the decoded JWT to have a user property when it does not.

A simple fix is to add the user property in the JWT callback

...
  callbacks: {
    jwt: async (token, user, account, profile, isNewUser) => {
      const isSignIn = user ? true : false;

      if (isSignIn) {
        token.user = { id: user.id }
      }

      return Promise.resolve(token);
    }
  },
...

Feedback

  • Found the documentation helpful
  • Found documentation but was incomplete
  • Could not find relevant documentation
  • Found the example project helpful
  • Did not find the example project helpful
@RobertCraigie RobertCraigie added the bug Something isn't working label Aug 31, 2020
@iaincollins
Copy link
Member

iaincollins commented Aug 31, 2020

Thanks for the bug reprot @RobertCraigie I think this makes sense!

In v3 release the JWT contents got refactored to use commonly supported JWT claims instead of a user object (e.g. it used to have .user object with .user.name, .user.email, etc but now the property names are just .name, .email).

It looks like the bug was introduced then.

That's for tracing the bug down! Line 55 and 56 in src/server/lib/callback-handler.js do seem to be the problem!

I'm adding some extra detail in below in case I forget - or if anyone else is able to pick this up!

Context

As part of the changes v3 we also removed exporting the User ID from the token by default.

This was done as we switched from encrypted by default (using a signed token that was then encrypted with AES) to only signed by default (with optional JWE compatible encryption able to be enabled by setting jwt.encryption: true) and I wanted to avoid exposing a User ID to the client if we didn't need to to enhance security and to reduce the default JWT payload size.

Both being encrypted by default and the JWT being too large by default were proving to be issues for users (as total cookie size per browser is 4096 bytes per domain there is much room to play with).

Fix

I don't think we want to back to encrypted tokens by default - as they are much larger and they introduce interoperability problems for people where they are passing on tokens to other services on the same domain.

To fix this bug we need to change both those lines and also add the User ID to the JWT if there is one. Using the sub claim seems to make the most sense.

If we update the contents of defaultJwtPayload in src/server/routes/callback.js (lines 87 and 177) for both the oauth and email flows to add the ID as the sub property and update lines 55 and 56 in src/server/lib/callback-handler.js according that should resolve this issue.

Note defaultJwtPayload is also defined in line 263 of src/server/routes/callback.js but for the Credentials flow, which is only supported without a database so we can ignore that instance.

Update: I meant to add what you've suggested is a great workaround until this is addressed!

@iaincollins iaincollins added help-needed The maintainer needs help due to time constraint/missing knowledge priority Priority fix or enhancement labels Aug 31, 2020
@RobertCraigie
Copy link
Contributor Author

Thanks for your really quick and informative reply!

After creating this issue I also noticed that two users are created if the end user signs in with an OAuth provider that does not grant access to an email address before signing in with email.

As far as I can tell this is because next-auth does not check if the user is already signed in, instead it just checks if the email address already belongs to a user and if it doesn't then a new user is created.

const userByEmail = profile.email ? await getUserByEmail(profile.email) : null
if (userByEmail) {
// If they are not already signed in as the same user, this flow will
// sign them out of the current session and sign them in as the new user
if (isSignedIn) {
if (user.id !== userByEmail.id && !useJwtSession) {
// Delete existing session if they are currently signed in as another user.
// This will switch user accounts for the session in cases where the user was
// already logged in with a different account.
await deleteSession(sessionToken)
}
}
// Update emailVerified property on the user object
const currentDate = new Date()
user = await updateUser({ ...userByEmail, emailVerified: currentDate })
await dispatchEvent(events.updateUser, user)
} else {
// Create user account if there isn't one for the email address already
const currentDate = new Date()
user = await createUser({ ...profile, emailVerified: currentDate })
await dispatchEvent(events.createUser, user)
isNewUser = true
}

@iaincollins
Copy link
Member

Thanks Robert!

Hmm, so - for context - things that are going on here:

  1. Currently users and email address are 1:1 and we do a curtsey check to help users avoid creating a second account by mistake. We don't automatically link them when they are the same, as it's not secure to do so across providers (as some providers let you sign in without verifying an email address, it can be used to hijack someone else's account).

    Originally NextAuth.js ONLY supported providers that returned email addresses to avoid this can of worms, but this was relaxed to allow support for providers that did not always return an email address.

    If a provider doesn't return an email address (or is associated with another email address the user has) then there isn't anything we can do. While the current behaviour is working as intended, ultimately we'd like to handle this more gracefully - e.g. with much better error handling if an email provider is configured.

  2. The built-in sign in page currently lets you 'link' accounts, but it shouldn't really. If you are signed in, it should either redirect to the homepage, or display a link/unlink page.

    Effectively it's acting as a 'link accounts' flow. I left in as an undocumented feature, until linking and unlinking and deleting accounts is properly restored (these were features in v1 but were not included in the re-write for v2).

    I thought I'd have already gotten around to doing this by now as it's very simple to add, but I've gotten overwhelmed by issues and pull requests. I think having this be explicit would address this more obvious though.

I think addressing point 2 - and address point 1 better at some point in the future - would both help resolve confusion relating to this.

We could also want to allow people to merge accounts, but that's probably quite far down the road - if 2 is implemented users will be able to do that themselves by unlinking and re-linking, which is probably sufficient in most cases (as automatically allowing folks merging accounts could introduce also sorts of other issues for people).

Supporting multiple email address per account (each with its own verified state) is still something I'd like to have, though is not yet on the roadmap. If we did that we'd want to give consideration as to how to do it in a backwards compatible way, with email address management - in practice, a single email address per user as practical limitation is fairly typical, so alternate / recover addresses are currently a nice-to-have.

@iaincollins
Copy link
Member

iaincollins commented Aug 31, 2020

Addendum: I didn't fully address what you'd raised in your comment, sorry.

The behaviour in Lines 71 to 96 should be reviewed.

My hunch is it's correct (in that if someone tries to sign in with an email address that is not associated with a user account, we should sign them in as a different user) and that we actually probably need to address this by providing a specific flow to add or change an email address on account.

I imagine we'd add that flow to the Link / Unlink page, and the most elegant way to do that is something I've been thinking of recently (with various pros/cons of having users just be able to change it but having the verification flag removed if they do, to requiring users to verify it before it's changed).

I would guess we would address that when we add Linking / Unlinking / Deleting accounts.

Tagging in #228 and #230

@RobertCraigie
Copy link
Contributor Author

That makes sense, thank you.

However in the meantime (until a specific flow for adding/changing email addresses is added), is a solution like this safe/valid?

if (providerAccount.type === 'email') {
  // If signing in with an email, check if an account with the same email address exists already
  const userByEmail = profile.email ? await getUserByEmail(profile.email) : null
  if (userByEmail) {
    ...
  } else if (isSignedIn) {
    // user is signed in with an account that is not linked to an email address
    // as they have just verified their email address it is safe to update the signed in user's email address
    const currentDate = new Date()
    user = await updateUser({ ...user, ...profile, emailVerified: currentDate })
    await dispatchEvent(events.updateUser, user)
  }
  ...
}

@iaincollins
Copy link
Member

Hmm I'm too tired to give you a good answer, I'll try and remember to look at this tomorrow, but the intent from the comments seems reasonable. :-)

I appreciate what is good behaviour here is a bit fuzzy, without a one-to-many user<->email relationship, but saving an address when linking if you don't already have one seems reasonable.

I think ideally we'd want to cherry pick the email field from the profile to add to the user object, rather than merging in the profile object, as you'd not want to override the name (if one was already specified). I think version 1.x (pre Serverless) did this too, for both email and the name field (only updating them when linking if they were not set).

We've just made some good progress on automating CD/CI tests today, so things should start moving quickly again soon - the main reason for not jumping on stuff like this sooner has been the pain of manual regression testing, but the OP is a great example of less common regression bug we can avoid in future by having a test case for it.

lukel97 added a commit to lukel97/next-auth that referenced this issue Oct 18, 2020
This allows us to check if the user is signed in when using JWTs

Part of nextauthjs#625
balazsorban44 pushed a commit that referenced this issue Dec 8, 2020
This allows us to check if the user is signed in when using JWTs

Part of #625
balazsorban44 pushed a commit that referenced this issue Feb 1, 2021
This allows us to check if the user is signed in when using JWTs

Part of #625
balazsorban44 added a commit that referenced this issue Feb 9, 2021
* feat: simplify NextAuth instantiation (#911)

* feat: allow react 17 as a peer dependency (#819)

Co-authored-by: Balázs Orbán <[email protected]>

* docs: update for Now to Vercel (#847)

Vercel archived their now packages a while back, so you can use vercel env pull to pull in the .env

* docs: fix discord example code (#850)

* docs: fix typo in callbacks.md (#815)

This is a simple typographical error changed accesed to accessed

* fix: update nodemailer version in response to CVE. (#860)

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7769 reports a high-severity issue with the current version of nodemailer. This should be merged and released right away if possible.

* fix: ensure Images are produced for discord (#734)

* fix: update Okta routes (#763)

the current routing for the Okta provider does not follow the standard
set by Okta, and as such doesn't allow for custom subdomains. this
update amends the routes to allow for customer subdomains, and also
aligns next-auth with Okta's documentation.

* fix(provider): handle no profile image for Spotify (#914)

* chore(deps): upgrade "standard"

* style(lint): run lint fix

* fix(provider): optional chain Spotify provider profile img

* Merge main into canary (#917)

* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* docs: Update default ports for support Databases (#839)

https://next-auth.js.org/configuration/databases

* Fix for Reddit Authentication (#866)

* Fixed Reddit Authentication

* updated fix for build test

* updated buffer to avoid deprecation message

* Updated for passing tests

* WIP: Update Docusaurus + Site dependencies (#802)

* update: deps

* fix: broken link

* fix: search upgrade change

* Include callbackUrl in newUser page (#790)

* Include callbackUrl in newUser page

* Update src/server/routes/callback.js

Co-authored-by: Iain Collins <[email protected]>

* Update src/server/routes/callback.js

Co-authored-by: Iain Collins <[email protected]>

Co-authored-by: Iain Collins <[email protected]>
Co-authored-by: Nico Domino <[email protected]>

* add(db): Add support for Fauna DB (#708)

* Add support for Fauna DB

* Add integration tests

Co-authored-by: Nico Domino <[email protected]>

* feat(provider): add netlify (#555)

Co-authored-by: styxlab <[email protected]>
Co-authored-by: Balázs Orbán <[email protected]>

* Bump next from 9.5.3 to 9.5.4 in /test/docker/app (#759)

Bumps [next](https://github.com/vercel/next.js) from 9.5.3 to 9.5.4.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](vercel/next.js@v9.5.3...v9.5.4)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nico Domino <[email protected]>

* feat(provider): Add Bungie (#589)

* Add Bungie provider

* Use absolute URL for images

* Correct image URL and use consistent formatting

Co-authored-by: Nico Domino <[email protected]>

* feat: add foursquare (#584)

* feat(provider): Add Azure Active Directory B2C (#921)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* doc: add provider to FAQ

* update(provider): Update Slack provider to use V2 OAuth endpoints (#895)

* Update Slack to v2 authorize urls, option for additional authorize params
* acessTokenGetter + documentation

* refactor(db): update Prisma calls to support 2.12+ (#881)

Co-authored-by: Balázs Orbán <[email protected]>
Co-authored-by: Nico Domino <[email protected]>

* chore(dep): Bump highlight.js from 9.18.1 to 9.18.5 (#880)

Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 9.18.1 to 9.18.5.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/9.18.5/CHANGES.md)
- [Commits](highlightjs/highlight.js@9.18.1...9.18.5)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Balázs Orbán <[email protected]>
Co-authored-by: Nico Domino <[email protected]>

* chore: disallow issues without template

* chore: add note about conveting questions to discussions

* chore: create PULL_REQUEST_TEMPLATE.md

* chore: reword PR template

* feat: Store user ID in sub claim of default JWT (#784)

This allows us to check if the user is signed in when using JWTs

Part of #625

* docs: fix incorrect references in cypress docs (#932)

* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* feat(provider): Add Azure Active Directory B2C (#809)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* Revert "feat(provider): Add Azure Active Directory B2C (#809)" (#919)

This reverts commit 6e6a24a.

* chore: add myself to the contributors list 🙈

* docs: fix incorrect references in cypress docs

* chore: add additional docs clarification

Co-authored-by: Balázs Orbán <[email protected]>
Co-authored-by: Vladimir Evdokimov <[email protected]>

* feat: Display error if no [...nextauth].js found (#678)

* Display error if no [...nextauth].js found

fixes #647

* Log the error and describe it inside errors.md

Co-authored-by: Balázs Orbán <[email protected]>

* chore(deps): Bump ini from 1.3.5 to 1.3.8 in /www (#953)

Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: fix typo Adapater -> Adapter (#960)

Co-authored-by: Balázs Orbán <[email protected]>
Co-authored-by: Vladimir Evdokimov <[email protected]>

* docs: We have twice the word "side" (#964)

* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* feat(provider): Add Azure Active Directory B2C (#809)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* Revert "feat(provider): Add Azure Active Directory B2C (#809)" (#919)

This reverts commit 6e6a24a.

* chore: add myself to the contributors list 🙈

* We have twice the word "side"

Co-authored-by: Balázs Orbán <[email protected]>
Co-authored-by: Vladimir Evdokimov <[email protected]>

* docs: Correcting a typo. "available" Line 70 (#965)

* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* feat(provider): Add Azure Active Directory B2C (#809)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* Revert "feat(provider): Add Azure Active Directory B2C (#809)" (#919)

This reverts commit 6e6a24a.

* chore: add myself to the contributors list 🙈

* Correcting a typo. "available" Line 70

Co-authored-by: Balázs Orbán <[email protected]>
Co-authored-by: Vladimir Evdokimov <[email protected]>

* chore: hide comments from pull request template

* Update README.md

Updated the readme to include the projects logo, fixed some typos, and added license info and contributor image.

* feat: add strava provider (#986)

* Add Strava as a provider

* Add documentation for Strava provider

* Fix lint errors

Co-authored-by: Paul Kenneth Kent <[email protected]>

* Update README.md

* Update README.md

* feat: add semantic-release (#920)

* chore(release): change semantic-release/git to semantic-release/github

* docs(database): add mssql indexes in docs, fix typos (#925)

* added mssql indexes in docs, fixed typo

* docs: fix typo in www/docs/schemas/mssql.md

Co-authored-by: Balázs Orbán <[email protected]>

* chore(release): delete old workflow

* chore(release): trigger release on docs type

* fix: treat user.id as optional param (#1010)

* fix(adapter): use findOne for typeorm (#1014)

* Change image to text from varchar (#777)

Co-authored-by: Nico Domino <[email protected]>

* feat(db): make Fauna DB collections & indexes configurable (#968)

* Add collections & indexes overrides for Fauna DB

* Fix the name of the verification token index

Co-authored-by: Florian Michaut <[email protected]>

* docs: Remove unnecessary promises (#915)

* feat: allow to return string in signIn callback (#1019)

* docs: small update to sign in/out examples (#1016)

* Update examples in client.md

* Update more examples

Co-authored-by: Balázs Orbán <[email protected]>

* docs: update contributing information [skip release] (#1011)

* docs: update CONTRIBUTING.md

* docs:  use db instead of database for more space

* docs: update CONTRIBUTING.md

* docs: update PR template

* docs: add note about skipping a release

* docs: fix typos in CONTRIBUTING.md [skip release]

* refactor: code base improvements (#959)

* chore: fix casing of OAuth

* refacotr: simplify default callbacks lib file

* refactor: use native URL instead of string concats

* refactor: move redirect to res.redirect, done to res.end

* refactor: move options to req

* refactor: improve IntelliSense, name all functions

* fix(lint): fix lint errors

* refactor: remove jwt-decode dependency

* refactor: refactor some callbacks to Promises

* revert: "refactor: use native URL instead of string concats"

Refs: 690c55b

* chore: misc changes

Co-authored-by: Balazs Orban <[email protected]>

* feat(provider): Add Mail.ru OAuth Service Provider and Callback snippet (#522)

* Update callback.js

- Fix Mail.ru bug (missing request parameter: access_token)

Note: setGetAccessTokenProfileUrl should be added to Mail.ru provider to enable support.

* Add Mail.ru OAuth Service Provider

* Update callbacks.md

- Fix broken callbacks snippet.

* Update callback.js

- Bug fix #522 (comment)
- Minor refactoring.

* Fix: Code linting.

* Update callback.js

Improve approach for building of URL based review recommendation.

* Feat: Reduce API surface expansion

Make use of provider.id === "mailru" as suggested in review discussion in place of setGetAccessTokenProfileUrl.

* Fix: Code linting

* feat: forward id_token to jwt and signIn callbacks (#1024)

* chore: add auto labeling to PRs [skip release] (#1025)

* chore: add auto labeling to PRs [skip release]

* chore: allow any file type for test label to be added

* chore: rename labeler.yaml to labeler.yml [skip release]

* fix: miscellaneous bugfixes (#1030)

* fix: use named params to fix order

* fix: avoid recursive redirects

* fix: revert to use parsed baseUrl

* fix: avoid recursive res.end calls

* fix: use named params in renderPage

* fix: promisify lib/oauth/callback result

* fix: don't chain on res.end on non-chainable res methods (#1031)

* docs: add powered by vercel logo [skip release]

* chore: run tests on canary [skip release]

* docs: misc improvements [skip release] (#1043)

* refactor: code base improvements 2 (#1045)

* fix: trigger release

* fix: use authorizationUrl correctly

* feat(provider): reduce user facing API (#1023)

Co-authored-by: Balazs Orban <[email protected]>

* fix: remove async from NextAuth default handler

This function should not return a Promise

* feat(provider): add vk.com provider (#1060)

* feat(provider): add vk.com provider

* refactor(provider): reduce vk.com provider api

* refactor: code base improvements 3 (#1072)

* refactor: extend res.{end,send,json}, redirect

* refactor: chain res methods, remove unnecessary ones

* refactor: simplify oauth callback signature

* refactor: code simplifications

* refactor: re-export everything from routes in one

* refactor: split up main index.js to multiple files

* refactor: simplify passing of provider(s) around

* refactor: extend req with callbackUrl inline

* refactor: simplify page rendering

* refactor: move error page redirects to main file, simplify renderer

* refactor: inline req.options definition

* refactor: simplify error fallbacks

* refactor: remove else branches and unnecessary try..catch

* refactor: add docs, and simplify jwt functions

* refactor: prefer errors object over switch..case in signin page

* feat: log all params sent to logger instead of only first

* refactor: fewer lines input validation

* refactor: remove even more unnecessary else branches

* feat: improve package development experience (#1064)

* chore(deps): add next and react to dev dependencies

* chore: move build configs to avoid crash with next dev

* chore: add next js dev app

* chore: remove .txt extension from LICENSE file

* chore: update CONTRIBUTING.md

* chore: watch css under development

* style(lint): run linter on index.css

* chore: fix some imports for dev server

* refactor: simplify client code

* chore: mention VSCode extension for linting

* docs: reword CONTRIBUTING.md

* chore: ignore linting pages and components

* fix: pass csrfToken to signin renderer

* feat: replace blur/focus event to visibility API for getSession (#1081)

* docs: clarify .env usage in CONTRIBUTING.md [skip release] (#1085)

* docs: improve FAQ docs [skip release]

* chore: update caiuse-lite db

* docs: update  some urls in the docs [skip release]

* feat(pages): add dark theme support (#1088)

* feat(pages): add dark theme support

* docs: document theme option

* chore: remove ts-check from dev app

* style(pages): fix some text colors in dark mode

* feat(provider): add LINE provider (#1091)

* refactor: be explicit about path in jsonconfig [skip release]

* refactor: show signin page in dev app [skip release]

* fix: export getSession [skip release]

somehow the default export does not work in the dev app

* style: make p system theme aware [skip release]

* feat(provider): finish Reddit provider and add documentation (#1094)

* Create reddit.md

* uncommented profile callback

* Update reddit.md

* fix lint issues

* added reddit provider

* added reddit provider

* Add Reddit Provider

For some reason a bunch of providers got deleted in the last commit

* Add Reddit Provider

* Add Reddit Provider

* chore: define providers in single file for docs [skip release]

* chore: Comply to Vercel Open Source sponsorship [skip release] (#1087)

* added banner

* Changed banner image allignment

* changed location of banner again

* added to acknowledgement

* added to acknowledgement 1

* changed image size

* k

* l

* s

* s

* .

* added link to the banner in readme.md

* fixed image redirect

* fixed image allignment

* made changes in readme and index.js

* Changed the source of the banner image

* added banner to the footer of the site

* chore: fix lint issues [skip release]

* feat: add native hkdf (#1124)

* feat: add native hkdf

* feat: import only needed to do hkdf

* feat: tweak digest and arguments

* chore(deps): upgrade typeorm to v0.2.30 (#1145)

* docs: remove v1 documentation (#1142)

* chore(adapters): remove fauna (#1148)

* feat: forward signIn auth params to /authorize (#1149)

* refactor: authorisation -> authorization

* feat: forward authorizationParams from signIn function

* refactor: take auth params as third argument

* docs: document signIn authorizationParams

* fix(adapter): fix ISO Datetime type error in Prisma updateSession (#640)

Co-authored-by: Nico Domino <[email protected]>
Co-authored-by: Balázs Orbán <[email protected]>

* feat(provider): add option to generate email verification token (#541)

* Add option to generate email verification token

* chore: remove unused import

* refactor: define default generateVerificationToken in-place

* refactor: define default generateVerificationToken in-place

Co-authored-by: Nico Domino <[email protected]>
Co-authored-by: Balázs Orbán <[email protected]>

* docs: update info about TypeScript [skip release]

* feat: add PKCE support (#941)

* chore(deps): upgrade dependencies

* chore(deps): add pkce-challenge

* feat(pkce): initial implementation of PCKE support

* chore: remove URLSearchParams

* chore(deps): upgrade lockfile

* refactor: store code_verifier in a cookie

* refactor: add pkce handlers

* docs: add PKCE documentation

* chore: remove unused param

* chore: revert unnecessary code change

* fix: correct variable names

* fix: correct logger import

* feat(provider): add Salesforce provider (#1027)

* docs(provider): add Salesforce provider

* fix(provider): use authed_user on slack instead of spotify (#1174)

* fix: use startsWith for protocol matching in parseUrl

closes #842

* fix: fix lint issues

* docs: clear things up around using access_token [skip release]

#1078

* docs: fix typo in callbacks.md [skip release]

* chore(provider): remove Mixer (#1178)

"Thank you to our amazing community and Partners.
As of July 22, the Mixer service has closed."

* feat(provider): re-add state, expand protection provider options  (#1184)

* refactor: move OAuthCallbackError to errors file

* refactor: improve pkce handling

* feat(provider): re-introduce state to provider options

* docs(provider): mention protection options "state" and "none"

* docs(provider): document state property deprecation

* fix: only add code_verifier param if protection is pkce

* docs: explain state deprecation better

* chore: unify string

* fix: send /authorize params through url

* fix: Add a null check to the window 'storage' event listener (#1198)

* Add a null check to the window 'storage' event listener

While testing in Cypress it's possible to receive a null value on Storage Events when 'clear' is called and will cause errors as seen in #1125.

* Update index.js

typo

* Update src/client/index.js

Co-authored-by: Balázs Orbán <[email protected]>

* formatting

Co-authored-by: Balázs Orbán <[email protected]>

* docs(provider): fix typos in providers code snippets [skip release] (#1204)

* docs(adapter): add adapter repo to documentation [skip release] (#1173)

* docs(adapter): add adapter repo to documentation

* docs(adapter): elaborate on custom repo

* fix: forward second argument to fetch body in signIn

fixes #1206

* docs: Fix grammar in "Feature Requests" section of FAQs [skip release] (#1212)

* refactor: provide raw idToken through account object (#1211)

* refactor: provide raw idToken through account object

* docs: clear up accessToken naming

* refactor: provide raw token response to account

* chore: fix grammar in comments

* feat: send all params to logger function (#1214)

* feat(provider): Add Medium (#1213)

* fix: leave accessTokenExpires as null

Forwarding expires_in as is to accessTokenExpires has shown to cause issues with Prisma, and maybe with other flows as well. Setting it back to `null` for now. We still forward `expires_in`, so users can use it if they want to.

Fixes #1216

* docs: more emphasis on req methods [skip release]

* docs: remove announcement bar [skip release]

* fix: make OAuth 1 work after refactoring (#1218)

* chore: add twitter provider to dev app

* feat: bind client instance to overriden methods

* fix: don't add extra params to getOAuthRequestToken

* chore: add twitter to env example, add secret gen instructions

* docs: Update Providers.Credential Example Block [skip release] (#1225)

Closing curly bracket where it should have been a square bracket.

* feat(provider): option to disable client-side redirects (credentials) (#1219)

* chore: add credentials provider to dev app

* feat: add redirect option to signIn, signOut

* feat: set correct status codes for credentials errors

* chore: add credentials page to dev app

* fix: support any provider name for credentials

* feat(ts): preliminary TypeScript support (#1223)

* chore: replace standard with ts-standard

* feat(ts): add some initial types

* feat(ts): import and use types

* chore: allow global fetch through package.json

* chore: upgrade lint scripts to use ts-standard

* chore: run linter on dev app

* chore(ts): satisfy dev Next.js server for TS

* fix: add eslint as dev dependency

* fix(lint): ignore next-env.d.ts from linting

* feat(ts): improve cookies options types

* fix: run linter with fix

* feat(provider): add EVE Online provider (#1227)

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

Co-authored-by: Gerald McNicholl <[email protected]>

* docs: clarify custom pages usage [skip release] (#1239)

* docs(provider): Update Atlassian docs (#1255)

* docs: Update Atlassian docs [skip release]

* Update atlassian.md

* fix(provider): okta client authentication (#1257)

* fix: okta client authentication

* chore: run lint fix

* Update pages/api/auth/[...nextauth].js

Co-authored-by: Balázs Orbán <[email protected]>

Co-authored-by: mgraser <[email protected]>
Co-authored-by: Balázs Orbán <[email protected]>

* chore: don't sync labels with labeler [skip release]

manually added PR labels were constantly removed on new commits/builds, this hopefully fixes that

* fix(provider): add verificationRequest flag to email signIn callback (#1258)

* fix(ui): use color text var for input color (#1260)

Co-authored-by: Archit Khode <[email protected]>

* docs: Minor text error fixed [skip release] (#1263)

* feat(provider): update session when signIn/signOut successful (#1267)

* feat(provider): update session when login/logout successful

* chore: remove manual page reload from dev app

* docs(client): document redirect: false

* fix(page): fix typo in error page

* Merge pull request from GHSA-pg53-56cg-4m8q

* fix(adapter): Verify identifier as well as token in Prisma adapter

* feat(adapter): Improve typeorm adapter

Improve conditional check in TypeORM adapter.

This should have no impact in practice but sets  a good example.

* docs(adapter): Update Prisma docs [skip release] (#1279) (#1283)

Co-authored-by: Iain Collins <[email protected]>

* docs(provider): Update azure-ad-b2c.md [skip release] (#1280)

* docs(adapter): Update Prisma docs (#1279)

* Update azure-ad-b2c.md

add hint for redirection URL, otherwise difficult to find out

* Update azure-ad-b2c.md

changed .env ro .env.local as per recommendation

* Update azure-ad-b2c.md

* Update azure-ad-b2c.md

* Update azure-ad-b2c.md

* update conf in .env.local 

follow the .env guidelines

* Update azure-ad-b2c.md

* Create azure-ad-b2c.md

* Create azure-ad-b2c.md

* Update azure-ad-b2c.md

Co-authored-by: Iain Collins <[email protected]>

* docs: Change "docs" to "documentation"

* fix(provider): Fixes for email sign in (#1285)

* fix(adapter): Fix Prisma delete

Must use Prsima deleteMany() instead of delete() with multiple clauses.

* feat: Update example project

Update example project to make it easier to test with database adapters.

* fix(ui): Fix message text in light / auto theme

Info message text is always on the same background (blue) on both themes so should always be white.

* docs: Update example .env [skip release]

* feat: Update Prisma peerOptionalDependencies

* docs: trigger release

Co-authored-by: Luke Lau <[email protected]>
Co-authored-by: James Perkins <[email protected]>
Co-authored-by: Joshua K. Martinez <[email protected]>
Co-authored-by: Pauldic <[email protected]>
Co-authored-by: Josh Padnick <[email protected]>
Co-authored-by: Daggy1234 <[email protected]>
Co-authored-by: Alan Ray <[email protected]>
Co-authored-by: Manish Chiniwalar <[email protected]>
Co-authored-by: Aymeric <[email protected]>
Co-authored-by: Nico Domino <[email protected]>
Co-authored-by: Fabrizio Ruggeri <[email protected]>
Co-authored-by: Iain Collins <[email protected]>
Co-authored-by: Joseph Vaughan <[email protected]>
Co-authored-by: Joost Jansky <[email protected]>
Co-authored-by: styxlab <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: RobertCraigie <[email protected]>
Co-authored-by: Joe Bell <[email protected]>
Co-authored-by: Vladimir Evdokimov <[email protected]>
Co-authored-by: Cathy Chen <[email protected]>
Co-authored-by: Kristóf Poduszló <[email protected]>
Co-authored-by: Haldun Anil <[email protected]>
Co-authored-by: Jakub Naskręski <[email protected]>
Co-authored-by: imgregduh <[email protected]>
Co-authored-by: pkabore <[email protected]>
Co-authored-by: Paul Kenneth Kent <[email protected]>
Co-authored-by: Paul Kenneth Kent <[email protected]>
Co-authored-by: Balazs Orban <[email protected]>
Co-authored-by: Junior Vidotti <[email protected]>
Co-authored-by: Yuma Matsune <[email protected]>
Co-authored-by: Ben West <[email protected]>
Co-authored-by: Florian Michaut <[email protected]>
Co-authored-by: Florian Michaut <[email protected]>
Co-authored-by: Melanie Seltzer <[email protected]>
Co-authored-by: Didi Keke <[email protected]>
Co-authored-by: Evgeniy Boreyko <[email protected]>
Co-authored-by: Alex B <[email protected]>
Co-authored-by: Ben <[email protected]>
Co-authored-by: suraj10k <[email protected]>
Co-authored-by: t.kuriyama <[email protected]>
Co-authored-by: Yuri Gor <[email protected]>
Co-authored-by: Radhika <[email protected]>
Co-authored-by: Henrik Wenz <[email protected]>
Co-authored-by: Zhao Lei <[email protected]>
Co-authored-by: Mohamed El Mahallawy <[email protected]>
Co-authored-by: Dillon Mulroy <[email protected]>
Co-authored-by: Carmelo Scandaliato <[email protected]>
Co-authored-by: Aishah <[email protected]>
Co-authored-by: Samson Zhang <[email protected]>
Co-authored-by: Vova <[email protected]>
Co-authored-by: Cody Ogden <[email protected]>
Co-authored-by: geraldm74 <[email protected]>
Co-authored-by: Gerald McNicholl <[email protected]>
Co-authored-by: Jeremy Caine <[email protected]>
Co-authored-by: Matthew Graser <[email protected]>
Co-authored-by: mgraser <[email protected]>
Co-authored-by: Kristofor Carle <[email protected]>
Co-authored-by: Archit Khode <[email protected]>
Co-authored-by: Archit Khode <[email protected]>
Co-authored-by: Daniel Gadd <[email protected]>
Co-authored-by: Robert Hufsky <[email protected]>
@balazsorban44 balazsorban44 removed the priority Priority fix or enhancement label Aug 13, 2021
@ThangHuuVu
Copy link
Member

Hi, @RobertCraigie, I'm closing this one because it was opened against v3 which is no longer maintained 👀
If you or anyone are still having this issue, feel free to open a new one against our latest package@auth/core 🙌 Thanks for your understanding 🙇‍♂️

mnphpexpert added a commit to mnphpexpert/next-auth that referenced this issue Sep 2, 2024
This allows us to check if the user is signed in when using JWTs

Part of nextauthjs#625
mnphpexpert added a commit to mnphpexpert/next-auth that referenced this issue Sep 2, 2024
* feat: simplify NextAuth instantiation (nextauthjs#911)

* feat: allow react 17 as a peer dependency (nextauthjs#819)

Co-authored-by: Balázs Orbán <[email protected]>

* docs: update for Now to Vercel (nextauthjs#847)

Vercel archived their now packages a while back, so you can use vercel env pull to pull in the .env

* docs: fix discord example code (nextauthjs#850)

* docs: fix typo in callbacks.md (nextauthjs#815)

This is a simple typographical error changed accesed to accessed

* fix: update nodemailer version in response to CVE. (nextauthjs#860)

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7769 reports a high-severity issue with the current version of nodemailer. This should be merged and released right away if possible.

* fix: ensure Images are produced for discord (nextauthjs#734)

* fix: update Okta routes (nextauthjs#763)

the current routing for the Okta provider does not follow the standard
set by Okta, and as such doesn't allow for custom subdomains. this
update amends the routes to allow for customer subdomains, and also
aligns next-auth with Okta's documentation.

* fix(provider): handle no profile image for Spotify (nextauthjs#914)

* chore(deps): upgrade "standard"

* style(lint): run lint fix

* fix(provider): optional chain Spotify provider profile img

* Merge main into canary (nextauthjs#917)

* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* docs: Update default ports for support Databases (nextauthjs#839)

https://next-auth.js.org/configuration/databases

* Fix for Reddit Authentication (nextauthjs#866)

* Fixed Reddit Authentication

* updated fix for build test

* updated buffer to avoid deprecation message

* Updated for passing tests

* WIP: Update Docusaurus + Site dependencies (nextauthjs#802)

* update: deps

* fix: broken link

* fix: search upgrade change

* Include callbackUrl in newUser page (nextauthjs#790)

* Include callbackUrl in newUser page

* Update src/server/routes/callback.js

Co-authored-by: Iain Collins <[email protected]>

* Update src/server/routes/callback.js

Co-authored-by: Iain Collins <[email protected]>

Co-authored-by: Iain Collins <[email protected]>
Co-authored-by: Nico Domino <[email protected]>

* add(db): Add support for Fauna DB (nextauthjs#708)

* Add support for Fauna DB

* Add integration tests

Co-authored-by: Nico Domino <[email protected]>

* feat(provider): add netlify (nextauthjs#555)

Co-authored-by: styxlab <[email protected]>
Co-authored-by: Balázs Orbán <[email protected]>

* Bump next from 9.5.3 to 9.5.4 in /test/docker/app (nextauthjs#759)

Bumps [next](https://github.com/vercel/next.js) from 9.5.3 to 9.5.4.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](vercel/next.js@v9.5.3...v9.5.4)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nico Domino <[email protected]>

* feat(provider): Add Bungie (nextauthjs#589)

* Add Bungie provider

* Use absolute URL for images

* Correct image URL and use consistent formatting

Co-authored-by: Nico Domino <[email protected]>

* feat: add foursquare (nextauthjs#584)

* feat(provider): Add Azure Active Directory B2C (nextauthjs#921)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* doc: add provider to FAQ

* update(provider): Update Slack provider to use V2 OAuth endpoints (nextauthjs#895)

* Update Slack to v2 authorize urls, option for additional authorize params
* acessTokenGetter + documentation

* refactor(db): update Prisma calls to support 2.12+ (nextauthjs#881)

Co-authored-by: Balázs Orbán <[email protected]>
Co-authored-by: Nico Domino <[email protected]>

* chore(dep): Bump highlight.js from 9.18.1 to 9.18.5 (nextauthjs#880)

Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 9.18.1 to 9.18.5.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/9.18.5/CHANGES.md)
- [Commits](highlightjs/highlight.js@9.18.1...9.18.5)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Balázs Orbán <[email protected]>
Co-authored-by: Nico Domino <[email protected]>

* chore: disallow issues without template

* chore: add note about conveting questions to discussions

* chore: create PULL_REQUEST_TEMPLATE.md

* chore: reword PR template

* feat: Store user ID in sub claim of default JWT (nextauthjs#784)

This allows us to check if the user is signed in when using JWTs

Part of nextauthjs#625

* docs: fix incorrect references in cypress docs (nextauthjs#932)

* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* feat(provider): Add Azure Active Directory B2C (nextauthjs#809)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* Revert "feat(provider): Add Azure Active Directory B2C (nextauthjs#809)" (nextauthjs#919)

This reverts commit 6e6a24a.

* chore: add myself to the contributors list 🙈

* docs: fix incorrect references in cypress docs

* chore: add additional docs clarification

Co-authored-by: Balázs Orbán <[email protected]>
Co-authored-by: Vladimir Evdokimov <[email protected]>

* feat: Display error if no [...nextauth].js found (nextauthjs#678)

* Display error if no [...nextauth].js found

fixes nextauthjs#647

* Log the error and describe it inside errors.md

Co-authored-by: Balázs Orbán <[email protected]>

* chore(deps): Bump ini from 1.3.5 to 1.3.8 in /www (nextauthjs#953)

Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: fix typo Adapater -> Adapter (nextauthjs#960)

Co-authored-by: Balázs Orbán <[email protected]>
Co-authored-by: Vladimir Evdokimov <[email protected]>

* docs: We have twice the word "side" (nextauthjs#964)

* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* feat(provider): Add Azure Active Directory B2C (nextauthjs#809)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* Revert "feat(provider): Add Azure Active Directory B2C (nextauthjs#809)" (nextauthjs#919)

This reverts commit 6e6a24a.

* chore: add myself to the contributors list 🙈

* We have twice the word "side"

Co-authored-by: Balázs Orbán <[email protected]>
Co-authored-by: Vladimir Evdokimov <[email protected]>

* docs: Correcting a typo. "available" Line 70 (nextauthjs#965)

* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* feat(provider): Add Azure Active Directory B2C (nextauthjs#809)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* Revert "feat(provider): Add Azure Active Directory B2C (nextauthjs#809)" (nextauthjs#919)

This reverts commit 6e6a24a.

* chore: add myself to the contributors list 🙈

* Correcting a typo. "available" Line 70

Co-authored-by: Balázs Orbán <[email protected]>
Co-authored-by: Vladimir Evdokimov <[email protected]>

* chore: hide comments from pull request template

* Update README.md

Updated the readme to include the projects logo, fixed some typos, and added license info and contributor image.

* feat: add strava provider (nextauthjs#986)

* Add Strava as a provider

* Add documentation for Strava provider

* Fix lint errors

Co-authored-by: Paul Kenneth Kent <[email protected]>

* Update README.md

* Update README.md

* feat: add semantic-release (nextauthjs#920)

* chore(release): change semantic-release/git to semantic-release/github

* docs(database): add mssql indexes in docs, fix typos (nextauthjs#925)

* added mssql indexes in docs, fixed typo

* docs: fix typo in www/docs/schemas/mssql.md

Co-authored-by: Balázs Orbán <[email protected]>

* chore(release): delete old workflow

* chore(release): trigger release on docs type

* fix: treat user.id as optional param (nextauthjs#1010)

* fix(adapter): use findOne for typeorm (nextauthjs#1014)

* Change image to text from varchar (nextauthjs#777)

Co-authored-by: Nico Domino <[email protected]>

* feat(db): make Fauna DB collections & indexes configurable (nextauthjs#968)

* Add collections & indexes overrides for Fauna DB

* Fix the name of the verification token index

Co-authored-by: Florian Michaut <[email protected]>

* docs: Remove unnecessary promises (nextauthjs#915)

* feat: allow to return string in signIn callback (nextauthjs#1019)

* docs: small update to sign in/out examples (nextauthjs#1016)

* Update examples in client.md

* Update more examples

Co-authored-by: Balázs Orbán <[email protected]>

* docs: update contributing information [skip release] (nextauthjs#1011)

* docs: update CONTRIBUTING.md

* docs:  use db instead of database for more space

* docs: update CONTRIBUTING.md

* docs: update PR template

* docs: add note about skipping a release

* docs: fix typos in CONTRIBUTING.md [skip release]

* refactor: code base improvements (nextauthjs#959)

* chore: fix casing of OAuth

* refacotr: simplify default callbacks lib file

* refactor: use native URL instead of string concats

* refactor: move redirect to res.redirect, done to res.end

* refactor: move options to req

* refactor: improve IntelliSense, name all functions

* fix(lint): fix lint errors

* refactor: remove jwt-decode dependency

* refactor: refactor some callbacks to Promises

* revert: "refactor: use native URL instead of string concats"

Refs: 690c55b

* chore: misc changes

Co-authored-by: Balazs Orban <[email protected]>

* feat(provider): Add Mail.ru OAuth Service Provider and Callback snippet (nextauthjs#522)

* Update callback.js

- Fix Mail.ru bug (missing request parameter: access_token)

Note: setGetAccessTokenProfileUrl should be added to Mail.ru provider to enable support.

* Add Mail.ru OAuth Service Provider

* Update callbacks.md

- Fix broken callbacks snippet.

* Update callback.js

- Bug fix nextauthjs#522 (comment)
- Minor refactoring.

* Fix: Code linting.

* Update callback.js

Improve approach for building of URL based review recommendation.

* Feat: Reduce API surface expansion

Make use of provider.id === "mailru" as suggested in review discussion in place of setGetAccessTokenProfileUrl.

* Fix: Code linting

* feat: forward id_token to jwt and signIn callbacks (nextauthjs#1024)

* chore: add auto labeling to PRs [skip release] (nextauthjs#1025)

* chore: add auto labeling to PRs [skip release]

* chore: allow any file type for test label to be added

* chore: rename labeler.yaml to labeler.yml [skip release]

* fix: miscellaneous bugfixes (nextauthjs#1030)

* fix: use named params to fix order

* fix: avoid recursive redirects

* fix: revert to use parsed baseUrl

* fix: avoid recursive res.end calls

* fix: use named params in renderPage

* fix: promisify lib/oauth/callback result

* fix: don't chain on res.end on non-chainable res methods (nextauthjs#1031)

* docs: add powered by vercel logo [skip release]

* chore: run tests on canary [skip release]

* docs: misc improvements [skip release] (nextauthjs#1043)

* refactor: code base improvements 2 (nextauthjs#1045)

* fix: trigger release

* fix: use authorizationUrl correctly

* feat(provider): reduce user facing API (nextauthjs#1023)

Co-authored-by: Balazs Orban <[email protected]>

* fix: remove async from NextAuth default handler

This function should not return a Promise

* feat(provider): add vk.com provider (nextauthjs#1060)

* feat(provider): add vk.com provider

* refactor(provider): reduce vk.com provider api

* refactor: code base improvements 3 (nextauthjs#1072)

* refactor: extend res.{end,send,json}, redirect

* refactor: chain res methods, remove unnecessary ones

* refactor: simplify oauth callback signature

* refactor: code simplifications

* refactor: re-export everything from routes in one

* refactor: split up main index.js to multiple files

* refactor: simplify passing of provider(s) around

* refactor: extend req with callbackUrl inline

* refactor: simplify page rendering

* refactor: move error page redirects to main file, simplify renderer

* refactor: inline req.options definition

* refactor: simplify error fallbacks

* refactor: remove else branches and unnecessary try..catch

* refactor: add docs, and simplify jwt functions

* refactor: prefer errors object over switch..case in signin page

* feat: log all params sent to logger instead of only first

* refactor: fewer lines input validation

* refactor: remove even more unnecessary else branches

* feat: improve package development experience (nextauthjs#1064)

* chore(deps): add next and react to dev dependencies

* chore: move build configs to avoid crash with next dev

* chore: add next js dev app

* chore: remove .txt extension from LICENSE file

* chore: update CONTRIBUTING.md

* chore: watch css under development

* style(lint): run linter on index.css

* chore: fix some imports for dev server

* refactor: simplify client code

* chore: mention VSCode extension for linting

* docs: reword CONTRIBUTING.md

* chore: ignore linting pages and components

* fix: pass csrfToken to signin renderer

* feat: replace blur/focus event to visibility API for getSession (nextauthjs#1081)

* docs: clarify .env usage in CONTRIBUTING.md [skip release] (nextauthjs#1085)

* docs: improve FAQ docs [skip release]

* chore: update caiuse-lite db

* docs: update  some urls in the docs [skip release]

* feat(pages): add dark theme support (nextauthjs#1088)

* feat(pages): add dark theme support

* docs: document theme option

* chore: remove ts-check from dev app

* style(pages): fix some text colors in dark mode

* feat(provider): add LINE provider (nextauthjs#1091)

* refactor: be explicit about path in jsonconfig [skip release]

* refactor: show signin page in dev app [skip release]

* fix: export getSession [skip release]

somehow the default export does not work in the dev app

* style: make p system theme aware [skip release]

* feat(provider): finish Reddit provider and add documentation (nextauthjs#1094)

* Create reddit.md

* uncommented profile callback

* Update reddit.md

* fix lint issues

* added reddit provider

* added reddit provider

* Add Reddit Provider

For some reason a bunch of providers got deleted in the last commit

* Add Reddit Provider

* Add Reddit Provider

* chore: define providers in single file for docs [skip release]

* chore: Comply to Vercel Open Source sponsorship [skip release] (nextauthjs#1087)

* added banner

* Changed banner image allignment

* changed location of banner again

* added to acknowledgement

* added to acknowledgement 1

* changed image size

* k

* l

* s

* s

* .

* added link to the banner in readme.md

* fixed image redirect

* fixed image allignment

* made changes in readme and index.js

* Changed the source of the banner image

* added banner to the footer of the site

* chore: fix lint issues [skip release]

* feat: add native hkdf (nextauthjs#1124)

* feat: add native hkdf

* feat: import only needed to do hkdf

* feat: tweak digest and arguments

* chore(deps): upgrade typeorm to v0.2.30 (nextauthjs#1145)

* docs: remove v1 documentation (nextauthjs#1142)

* chore(adapters): remove fauna (nextauthjs#1148)

* feat: forward signIn auth params to /authorize (nextauthjs#1149)

* refactor: authorisation -> authorization

* feat: forward authorizationParams from signIn function

* refactor: take auth params as third argument

* docs: document signIn authorizationParams

* fix(adapter): fix ISO Datetime type error in Prisma updateSession (nextauthjs#640)

Co-authored-by: Nico Domino <[email protected]>
Co-authored-by: Balázs Orbán <[email protected]>

* feat(provider): add option to generate email verification token (nextauthjs#541)

* Add option to generate email verification token

* chore: remove unused import

* refactor: define default generateVerificationToken in-place

* refactor: define default generateVerificationToken in-place

Co-authored-by: Nico Domino <[email protected]>
Co-authored-by: Balázs Orbán <[email protected]>

* docs: update info about TypeScript [skip release]

* feat: add PKCE support (nextauthjs#941)

* chore(deps): upgrade dependencies

* chore(deps): add pkce-challenge

* feat(pkce): initial implementation of PCKE support

* chore: remove URLSearchParams

* chore(deps): upgrade lockfile

* refactor: store code_verifier in a cookie

* refactor: add pkce handlers

* docs: add PKCE documentation

* chore: remove unused param

* chore: revert unnecessary code change

* fix: correct variable names

* fix: correct logger import

* feat(provider): add Salesforce provider (nextauthjs#1027)

* docs(provider): add Salesforce provider

* fix(provider): use authed_user on slack instead of spotify (nextauthjs#1174)

* fix: use startsWith for protocol matching in parseUrl

closes nextauthjs#842

* fix: fix lint issues

* docs: clear things up around using access_token [skip release]

nextauthjs#1078

* docs: fix typo in callbacks.md [skip release]

* chore(provider): remove Mixer (nextauthjs#1178)

"Thank you to our amazing community and Partners.
As of July 22, the Mixer service has closed."

* feat(provider): re-add state, expand protection provider options  (nextauthjs#1184)

* refactor: move OAuthCallbackError to errors file

* refactor: improve pkce handling

* feat(provider): re-introduce state to provider options

* docs(provider): mention protection options "state" and "none"

* docs(provider): document state property deprecation

* fix: only add code_verifier param if protection is pkce

* docs: explain state deprecation better

* chore: unify string

* fix: send /authorize params through url

* fix: Add a null check to the window 'storage' event listener (nextauthjs#1198)

* Add a null check to the window 'storage' event listener

While testing in Cypress it's possible to receive a null value on Storage Events when 'clear' is called and will cause errors as seen in nextauthjs#1125.

* Update index.js

typo

* Update src/client/index.js

Co-authored-by: Balázs Orbán <[email protected]>

* formatting

Co-authored-by: Balázs Orbán <[email protected]>

* docs(provider): fix typos in providers code snippets [skip release] (nextauthjs#1204)

* docs(adapter): add adapter repo to documentation [skip release] (nextauthjs#1173)

* docs(adapter): add adapter repo to documentation

* docs(adapter): elaborate on custom repo

* fix: forward second argument to fetch body in signIn

fixes nextauthjs#1206

* docs: Fix grammar in "Feature Requests" section of FAQs [skip release] (nextauthjs#1212)

* refactor: provide raw idToken through account object (nextauthjs#1211)

* refactor: provide raw idToken through account object

* docs: clear up accessToken naming

* refactor: provide raw token response to account

* chore: fix grammar in comments

* feat: send all params to logger function (nextauthjs#1214)

* feat(provider): Add Medium (nextauthjs#1213)

* fix: leave accessTokenExpires as null

Forwarding expires_in as is to accessTokenExpires has shown to cause issues with Prisma, and maybe with other flows as well. Setting it back to `null` for now. We still forward `expires_in`, so users can use it if they want to.

Fixes nextauthjs#1216

* docs: more emphasis on req methods [skip release]

* docs: remove announcement bar [skip release]

* fix: make OAuth 1 work after refactoring (nextauthjs#1218)

* chore: add twitter provider to dev app

* feat: bind client instance to overriden methods

* fix: don't add extra params to getOAuthRequestToken

* chore: add twitter to env example, add secret gen instructions

* docs: Update Providers.Credential Example Block [skip release] (nextauthjs#1225)

Closing curly bracket where it should have been a square bracket.

* feat(provider): option to disable client-side redirects (credentials) (nextauthjs#1219)

* chore: add credentials provider to dev app

* feat: add redirect option to signIn, signOut

* feat: set correct status codes for credentials errors

* chore: add credentials page to dev app

* fix: support any provider name for credentials

* feat(ts): preliminary TypeScript support (nextauthjs#1223)

* chore: replace standard with ts-standard

* feat(ts): add some initial types

* feat(ts): import and use types

* chore: allow global fetch through package.json

* chore: upgrade lint scripts to use ts-standard

* chore: run linter on dev app

* chore(ts): satisfy dev Next.js server for TS

* fix: add eslint as dev dependency

* fix(lint): ignore next-env.d.ts from linting

* feat(ts): improve cookies options types

* fix: run linter with fix

* feat(provider): add EVE Online provider (nextauthjs#1227)

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

Co-authored-by: Gerald McNicholl <[email protected]>

* docs: clarify custom pages usage [skip release] (nextauthjs#1239)

* docs(provider): Update Atlassian docs (nextauthjs#1255)

* docs: Update Atlassian docs [skip release]

* Update atlassian.md

* fix(provider): okta client authentication (nextauthjs#1257)

* fix: okta client authentication

* chore: run lint fix

* Update pages/api/auth/[...nextauth].js

Co-authored-by: Balázs Orbán <[email protected]>

Co-authored-by: mgraser <[email protected]>
Co-authored-by: Balázs Orbán <[email protected]>

* chore: don't sync labels with labeler [skip release]

manually added PR labels were constantly removed on new commits/builds, this hopefully fixes that

* fix(provider): add verificationRequest flag to email signIn callback (nextauthjs#1258)

* fix(ui): use color text var for input color (nextauthjs#1260)

Co-authored-by: Archit Khode <[email protected]>

* docs: Minor text error fixed [skip release] (nextauthjs#1263)

* feat(provider): update session when signIn/signOut successful (nextauthjs#1267)

* feat(provider): update session when login/logout successful

* chore: remove manual page reload from dev app

* docs(client): document redirect: false

* fix(page): fix typo in error page

* Merge pull request from GHSA-pg53-56cg-4m8q

* fix(adapter): Verify identifier as well as token in Prisma adapter

* feat(adapter): Improve typeorm adapter

Improve conditional check in TypeORM adapter.

This should have no impact in practice but sets  a good example.

* docs(adapter): Update Prisma docs [skip release] (nextauthjs#1279) (nextauthjs#1283)

Co-authored-by: Iain Collins <[email protected]>

* docs(provider): Update azure-ad-b2c.md [skip release] (nextauthjs#1280)

* docs(adapter): Update Prisma docs (nextauthjs#1279)

* Update azure-ad-b2c.md

add hint for redirection URL, otherwise difficult to find out

* Update azure-ad-b2c.md

changed .env ro .env.local as per recommendation

* Update azure-ad-b2c.md

* Update azure-ad-b2c.md

* Update azure-ad-b2c.md

* update conf in .env.local 

follow the .env guidelines

* Update azure-ad-b2c.md

* Create azure-ad-b2c.md

* Create azure-ad-b2c.md

* Update azure-ad-b2c.md

Co-authored-by: Iain Collins <[email protected]>

* docs: Change "docs" to "documentation"

* fix(provider): Fixes for email sign in (nextauthjs#1285)

* fix(adapter): Fix Prisma delete

Must use Prsima deleteMany() instead of delete() with multiple clauses.

* feat: Update example project

Update example project to make it easier to test with database adapters.

* fix(ui): Fix message text in light / auto theme

Info message text is always on the same background (blue) on both themes so should always be white.

* docs: Update example .env [skip release]

* feat: Update Prisma peerOptionalDependencies

* docs: trigger release

Co-authored-by: Luke Lau <[email protected]>
Co-authored-by: James Perkins <[email protected]>
Co-authored-by: Joshua K. Martinez <[email protected]>
Co-authored-by: Pauldic <[email protected]>
Co-authored-by: Josh Padnick <[email protected]>
Co-authored-by: Daggy1234 <[email protected]>
Co-authored-by: Alan Ray <[email protected]>
Co-authored-by: Manish Chiniwalar <[email protected]>
Co-authored-by: Aymeric <[email protected]>
Co-authored-by: Nico Domino <[email protected]>
Co-authored-by: Fabrizio Ruggeri <[email protected]>
Co-authored-by: Iain Collins <[email protected]>
Co-authored-by: Joseph Vaughan <[email protected]>
Co-authored-by: Joost Jansky <[email protected]>
Co-authored-by: styxlab <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: RobertCraigie <[email protected]>
Co-authored-by: Joe Bell <[email protected]>
Co-authored-by: Vladimir Evdokimov <[email protected]>
Co-authored-by: Cathy Chen <[email protected]>
Co-authored-by: Kristóf Poduszló <[email protected]>
Co-authored-by: Haldun Anil <[email protected]>
Co-authored-by: Jakub Naskręski <[email protected]>
Co-authored-by: imgregduh <[email protected]>
Co-authored-by: pkabore <[email protected]>
Co-authored-by: Paul Kenneth Kent <[email protected]>
Co-authored-by: Paul Kenneth Kent <[email protected]>
Co-authored-by: Balazs Orban <[email protected]>
Co-authored-by: Junior Vidotti <[email protected]>
Co-authored-by: Yuma Matsune <[email protected]>
Co-authored-by: Ben West <[email protected]>
Co-authored-by: Florian Michaut <[email protected]>
Co-authored-by: Florian Michaut <[email protected]>
Co-authored-by: Melanie Seltzer <[email protected]>
Co-authored-by: Didi Keke <[email protected]>
Co-authored-by: Evgeniy Boreyko <[email protected]>
Co-authored-by: Alex B <[email protected]>
Co-authored-by: Ben <[email protected]>
Co-authored-by: suraj10k <[email protected]>
Co-authored-by: t.kuriyama <[email protected]>
Co-authored-by: Yuri Gor <[email protected]>
Co-authored-by: Radhika <[email protected]>
Co-authored-by: Henrik Wenz <[email protected]>
Co-authored-by: Zhao Lei <[email protected]>
Co-authored-by: Mohamed El Mahallawy <[email protected]>
Co-authored-by: Dillon Mulroy <[email protected]>
Co-authored-by: Carmelo Scandaliato <[email protected]>
Co-authored-by: Aishah <[email protected]>
Co-authored-by: Samson Zhang <[email protected]>
Co-authored-by: Vova <[email protected]>
Co-authored-by: Cody Ogden <[email protected]>
Co-authored-by: geraldm74 <[email protected]>
Co-authored-by: Gerald McNicholl <[email protected]>
Co-authored-by: Jeremy Caine <[email protected]>
Co-authored-by: Matthew Graser <[email protected]>
Co-authored-by: mgraser <[email protected]>
Co-authored-by: Kristofor Carle <[email protected]>
Co-authored-by: Archit Khode <[email protected]>
Co-authored-by: Archit Khode <[email protected]>
Co-authored-by: Daniel Gadd <[email protected]>
Co-authored-by: Robert Hufsky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help-needed The maintainer needs help due to time constraint/missing knowledge
Projects
None yet
Development

No branches or pull requests

4 participants