-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
add(db): Add support for Fauna DB #708
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nextauthjs/next-auth/pm2amj343 |
Hi! I'd like to know what's the difference between this PR and that? |
Hi @waptik, I hadn't seen that other PR until after submitting this one unfortunately. It looks very similar, but I cannot speak of its implementation as I have not tested it. I don't have a working example, but am using this in one of my apps. My [...nextauth].js file contains the following configuration
|
Ah i see. The only difference in the implementation so far as i can see is that it already calls faunaClient instead of having it as a parameter. |
Hello , |
@iaincollins I've added some integration tests to the style of the existing ones, please let me know if you'd like me to change anything, as I am not up to scratch with testing patterns in javascript. It uses a fauna docker instance. I am a bit wary of it however, as it seems quite memory hungry. Happy to hear your thoughts on the implementation and hope it's useful |
Hello, @iaincollins, are there any estimations when this can be merged? |
What is the ETA on merging the Fauna support? I am happy to dig in for code review if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reviewed the changes here.
All look in the same style as other adapters and FaunaDB code looks great.
Hmm I still get the same error after install. I think this is on my end so I will dig in |
So I tried it myself, and I'm not positive what exactly npm is doing on install as the Anyway, I tried just cloning the repo (canary branch) into |
Hey everyone, I managed to install the latest canary branch into my
I run the above inside an This is what my
I do see the new version inside the
I tried to debug, but haven't had good luck! thank you in advance if you have already figured this out and you are willing to help out :) |
Hi there @csanz. It's something with React, unfortunately. You could try this: https://github.com/nextauthjs/next-auth/blob/canary/CONTRIBUTING.md#setting-up-local-environment We hope to get a |
Thank you sir 🙇🏻♂️ |
I come here a bit late but is it possible to put the collection & index names in variables ? Maybe in the options of the Adapter ? So it can be used in any kind of Fauna Database. |
Oh! you mean something like: ...
const collections = {
account: 'something',
user: 'something',
session: 'something',
vr: 'something',
}
const indexes= {
account: 'something',
user: 'something',
session: 'something',
vr: 'something',
}
...
const options = {
...
adapter: Adapters.Fauna.Adapter({collections, indexes})
...
};
... I think this initial version of the adapter is targeted to those who want to use a fresh faunadb database with nextauth. Because based on the source code, when using collections and indexes, their names are hardcoded.
@s-kris did a similar thing over at https://gist.github.com/s-kris/fbb9e5d7ba5e9bb3a5f7bd11f3c42b96 where he declared the collections and indexes as variables then use theses variables wherever needed. |
Sorry for my delay in responding to this, it's been a hectic few months. Happy to see this is merged, thank you :-)
That would be ideal, I tried to keep this as similar as possible to the existing adapters. I imagine it would be a welcome change to all of them. @ndom91 I will try and look at getting some docs adjustments to you over the holidays. Thanks again! |
Great stuff, thanks a lot everyone! |
This is definitly something I can do. Should I create a new merge request with the changes ? |
@n44ps yeah a new PR would be great! |
Just getting started with Next.js, Next Auth, and Fauna DB. I am trying to get the Next Auth example working with Fauna. From a configuration standpoint, what are the necessary steps? It looks like the Fauna adapter was added recently, but how do I use it? I've reviewed a bunch of docs, but don't see a precise path. I think the steps involve just a change to the [...nextauth].js file and .env.local file. Is this correct? It appears I need to add this to my [...nextauth].js file:
And then I know I need to update the variables (like FAUNADB_SECRET_KEY) in my .env.local file. Not sure where to put the exact config for database URL and what is it for Fauna? I'm hoping someone can provide precise details on which values need to be configured in the .env.local file? And precise changes to [...nextauth].js file? And any other changes? Thanks so much! Noob here 🙄 |
Using the next-auth example, you neeed to:
|
Thanks @waptik for the details. I didn't have latest canary version installed. I was confused where to set the URL for a Fauna DB but I see now it's specified in the "faunadb" module included in latest canary version of next-auth. Thanks again for the assist! |
Yeah sure, no problem. Glad i could be of any assist |
I have the adapter mostly working with my Fauna database. It seems I can write to the database (verification requests are saving to the verifiation_request collection for email verification) but I'm getting read errors in the terminal (GET_SESSION_ERROR and GET_VERIFICATION_REQUEST_ERROR) which is preventing me from any successful log in. Anyone else run into this? Update: There is a typo in the database setup script here. This resolved the GET_VERIFICATION_REQUEST_ERROR for me. Still looking into the GET_SESSION_ERROR. |
Try clearing emptying the collections and indexes to see if it'll work |
Created a brand new DB on Fauna and set it up. Verification Requests collection is populating but still getting GET_SESSION_ERROR when using the Log In link in email. Have you used the Fauna adapter with Email provider? That's all I'm using for now and I have it working with Prisma/MySql but not Fauna. |
Could you please move this to a discussion @taylorhlabs? In addition of being it a better place for such conversations than a closed PR, it may be more easily accessible for people in the future with similar problems. Thanks! |
Yes, moved it to this discussion. Was thinking this was not the right place... Thanks! |
* Add support for Fauna DB * Add integration tests Co-authored-by: Nico Domino <yo@ndo.dev>
🎉 This PR is included in version 3.3.0-canary.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* feat: simplify NextAuth instantiation (#911) * feat: allow react 17 as a peer dependency (#819) Co-authored-by: Balázs Orbán <info@balazsorban.com> * 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 <me@iaincollins.com> * Update src/server/routes/callback.js Co-authored-by: Iain Collins <me@iaincollins.com> Co-authored-by: Iain Collins <me@iaincollins.com> Co-authored-by: Nico Domino <yo@ndo.dev> * add(db): Add support for Fauna DB (#708) * Add support for Fauna DB * Add integration tests Co-authored-by: Nico Domino <yo@ndo.dev> * feat(provider): add netlify (#555) Co-authored-by: styxlab <cws@DE01WP777.scdom.net> Co-authored-by: Balázs Orbán <info@balazsorban.com> * 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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nico Domino <yo@ndo.dev> * 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 <yo@ndo.dev> * 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 <info@balazsorban.com> Co-authored-by: Nico Domino <yo@ndo.dev> * 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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Balázs Orbán <info@balazsorban.com> Co-authored-by: Nico Domino <yo@ndo.dev> * 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 <info@balazsorban.com> Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com> * 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 <info@balazsorban.com> * 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] <support@github.com> 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 <info@balazsorban.com> Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com> * 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 <info@balazsorban.com> Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com> * 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 <info@balazsorban.com> Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com> * 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 <paul@ventureharbour.com> * 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 <info@balazsorban.com> * 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 <yo@ndo.dev> * 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 <florian@coding-days.com> * 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 <info@balazsorban.com> * 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 <balazs@nhi.no> * 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 <balazs@nhi.no> * 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 <yo@ndo.dev> Co-authored-by: Balázs Orbán <info@balazsorban.com> * 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 <yo@ndo.dev> Co-authored-by: Balázs Orbán <info@balazsorban.com> * 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 <info@balazsorban.com> * formatting Co-authored-by: Balázs Orbán <info@balazsorban.com> * 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 <gerald.mcnicholl@xero.com> * 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 <info@balazsorban.com> Co-authored-by: mgraser <matt.graser@mlb.com> Co-authored-by: Balázs Orbán <info@balazsorban.com> * 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 <archit.khode@gmail.com> * 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 <me@iaincollins.com> * 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 <me@iaincollins.com> * 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 <luke_lau@icloud.com> Co-authored-by: James Perkins <jamesperkins@hey.com> Co-authored-by: Joshua K. Martinez <joshkmartinez@gmail.com> Co-authored-by: Pauldic <Pauldiconline@yahoo.com> Co-authored-by: Josh Padnick <josh@gruntwork.io> Co-authored-by: Daggy1234 <arnav.jindal7@gmail.com> Co-authored-by: Alan Ray <71240883+ohheyalanray@users.noreply.github.com> Co-authored-by: Manish Chiniwalar <manishrc@users.noreply.github.com> Co-authored-by: Aymeric <34040599+afoyer@users.noreply.github.com> Co-authored-by: Nico Domino <yo@ndo.dev> Co-authored-by: Fabrizio Ruggeri <ramiel@users.noreply.github.com> Co-authored-by: Iain Collins <me@iaincollins.com> Co-authored-by: Joseph Vaughan <Joev-@users.noreply.github.com> Co-authored-by: Joost Jansky <styxlab@users.noreply.github.com> Co-authored-by: styxlab <cws@DE01WP777.scdom.net> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: RobertCraigie <robertcraigie30@gmail.com> Co-authored-by: Joe Bell <joe@joebell.co.uk> Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com> Co-authored-by: Cathy Chen <cathykaichen@gmail.com> Co-authored-by: Kristóf Poduszló <kripod@protonmail.com> Co-authored-by: Haldun Anil <haldunanil@users.noreply.github.com> Co-authored-by: Jakub Naskręski <36169811+kleyu@users.noreply.github.com> Co-authored-by: imgregduh <imgregorywong@gmail.com> Co-authored-by: pkabore <paulkabore333@gmail.com> Co-authored-by: Paul Kenneth Kent <pkennethkent@gmail.com> Co-authored-by: Paul Kenneth Kent <paul@ventureharbour.com> Co-authored-by: Balazs Orban <balazs@nhi.no> Co-authored-by: Junior Vidotti <jrvidotti@gmail.com> Co-authored-by: Yuma Matsune <yuma.matsune@gmail.com> Co-authored-by: Ben West <Xodarap@users.noreply.github.com> Co-authored-by: Florian Michaut <florianmichaut@gmail.com> Co-authored-by: Florian Michaut <florian@coding-days.com> Co-authored-by: Melanie Seltzer <melleh11@gmail.com> Co-authored-by: Didi Keke <nyedidikeke@users.noreply.github.com> Co-authored-by: Evgeniy Boreyko <boreykojenya@yandex.ru> Co-authored-by: Alex B <lnikell@gmail.com> Co-authored-by: Ben <5271788+bebax@users.noreply.github.com> Co-authored-by: suraj10k <63460026+suraj10k@users.noreply.github.com> Co-authored-by: t.kuriyama <koolii0909@gmail.com> Co-authored-by: Yuri Gor <YuriGor@users.noreply.github.com> Co-authored-by: Radhika <56536997+96RadhikaJadhav@users.noreply.github.com> Co-authored-by: Henrik Wenz <HaNdTriX@users.noreply.github.com> Co-authored-by: Zhao Lei <firede@firede.com> Co-authored-by: Mohamed El Mahallawy <mmahalwy@gmail.com> Co-authored-by: Dillon Mulroy <dillon.mulroy@gmail.com> Co-authored-by: Carmelo Scandaliato <8927157+cascandaliato@users.noreply.github.com> Co-authored-by: Aishah <aissshah@outlook.com> Co-authored-by: Samson Zhang <wwsamson@yahoo.com> Co-authored-by: Vova <volodimir.partytskyi@gmail.com> Co-authored-by: Cody Ogden <cody@codyogden.com> Co-authored-by: geraldm74 <gerald_mcnicholl@yahoo.com> Co-authored-by: Gerald McNicholl <gerald.mcnicholl@xero.com> Co-authored-by: Jeremy Caine <jezcaine@gmail.com> Co-authored-by: Matthew Graser <mdgraser@gmail.com> Co-authored-by: mgraser <matt.graser@mlb.com> Co-authored-by: Kristofor Carle <kris@maphubs.com> Co-authored-by: Archit Khode <arkits@outlook.com> Co-authored-by: Archit Khode <archit.khode@gmail.com> Co-authored-by: Daniel Gadd <danielgadd@outlook.com> Co-authored-by: Robert Hufsky <Robert.Hufsky@gmx.net>
* Add support for Fauna DB * Add integration tests Co-authored-by: Nico Domino <yo@ndo.dev>
* feat: simplify NextAuth instantiation (nextauthjs#911) * feat: allow react 17 as a peer dependency (nextauthjs#819) Co-authored-by: Balázs Orbán <info@balazsorban.com> * 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 <me@iaincollins.com> * Update src/server/routes/callback.js Co-authored-by: Iain Collins <me@iaincollins.com> Co-authored-by: Iain Collins <me@iaincollins.com> Co-authored-by: Nico Domino <yo@ndo.dev> * add(db): Add support for Fauna DB (nextauthjs#708) * Add support for Fauna DB * Add integration tests Co-authored-by: Nico Domino <yo@ndo.dev> * feat(provider): add netlify (nextauthjs#555) Co-authored-by: styxlab <cws@DE01WP777.scdom.net> Co-authored-by: Balázs Orbán <info@balazsorban.com> * 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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nico Domino <yo@ndo.dev> * 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 <yo@ndo.dev> * 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 <info@balazsorban.com> Co-authored-by: Nico Domino <yo@ndo.dev> * 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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Balázs Orbán <info@balazsorban.com> Co-authored-by: Nico Domino <yo@ndo.dev> * 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 <info@balazsorban.com> Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com> * 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 <info@balazsorban.com> * 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] <support@github.com> 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 <info@balazsorban.com> Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com> * 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 <info@balazsorban.com> Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com> * 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 <info@balazsorban.com> Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com> * 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 <paul@ventureharbour.com> * 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 <info@balazsorban.com> * 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 <yo@ndo.dev> * 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 <florian@coding-days.com> * 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 <info@balazsorban.com> * 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 <balazs@nhi.no> * 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 <balazs@nhi.no> * 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 <yo@ndo.dev> Co-authored-by: Balázs Orbán <info@balazsorban.com> * 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 <yo@ndo.dev> Co-authored-by: Balázs Orbán <info@balazsorban.com> * 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 <info@balazsorban.com> * formatting Co-authored-by: Balázs Orbán <info@balazsorban.com> * 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 <gerald.mcnicholl@xero.com> * 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 <info@balazsorban.com> Co-authored-by: mgraser <matt.graser@mlb.com> Co-authored-by: Balázs Orbán <info@balazsorban.com> * 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 <archit.khode@gmail.com> * 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 <me@iaincollins.com> * 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 <me@iaincollins.com> * 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 <luke_lau@icloud.com> Co-authored-by: James Perkins <jamesperkins@hey.com> Co-authored-by: Joshua K. Martinez <joshkmartinez@gmail.com> Co-authored-by: Pauldic <Pauldiconline@yahoo.com> Co-authored-by: Josh Padnick <josh@gruntwork.io> Co-authored-by: Daggy1234 <arnav.jindal7@gmail.com> Co-authored-by: Alan Ray <71240883+ohheyalanray@users.noreply.github.com> Co-authored-by: Manish Chiniwalar <manishrc@users.noreply.github.com> Co-authored-by: Aymeric <34040599+afoyer@users.noreply.github.com> Co-authored-by: Nico Domino <yo@ndo.dev> Co-authored-by: Fabrizio Ruggeri <ramiel@users.noreply.github.com> Co-authored-by: Iain Collins <me@iaincollins.com> Co-authored-by: Joseph Vaughan <Joev-@users.noreply.github.com> Co-authored-by: Joost Jansky <styxlab@users.noreply.github.com> Co-authored-by: styxlab <cws@DE01WP777.scdom.net> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: RobertCraigie <robertcraigie30@gmail.com> Co-authored-by: Joe Bell <joe@joebell.co.uk> Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com> Co-authored-by: Cathy Chen <cathykaichen@gmail.com> Co-authored-by: Kristóf Poduszló <kripod@protonmail.com> Co-authored-by: Haldun Anil <haldunanil@users.noreply.github.com> Co-authored-by: Jakub Naskręski <36169811+kleyu@users.noreply.github.com> Co-authored-by: imgregduh <imgregorywong@gmail.com> Co-authored-by: pkabore <paulkabore333@gmail.com> Co-authored-by: Paul Kenneth Kent <pkennethkent@gmail.com> Co-authored-by: Paul Kenneth Kent <paul@ventureharbour.com> Co-authored-by: Balazs Orban <balazs@nhi.no> Co-authored-by: Junior Vidotti <jrvidotti@gmail.com> Co-authored-by: Yuma Matsune <yuma.matsune@gmail.com> Co-authored-by: Ben West <Xodarap@users.noreply.github.com> Co-authored-by: Florian Michaut <florianmichaut@gmail.com> Co-authored-by: Florian Michaut <florian@coding-days.com> Co-authored-by: Melanie Seltzer <melleh11@gmail.com> Co-authored-by: Didi Keke <nyedidikeke@users.noreply.github.com> Co-authored-by: Evgeniy Boreyko <boreykojenya@yandex.ru> Co-authored-by: Alex B <lnikell@gmail.com> Co-authored-by: Ben <5271788+bebax@users.noreply.github.com> Co-authored-by: suraj10k <63460026+suraj10k@users.noreply.github.com> Co-authored-by: t.kuriyama <koolii0909@gmail.com> Co-authored-by: Yuri Gor <YuriGor@users.noreply.github.com> Co-authored-by: Radhika <56536997+96RadhikaJadhav@users.noreply.github.com> Co-authored-by: Henrik Wenz <HaNdTriX@users.noreply.github.com> Co-authored-by: Zhao Lei <firede@firede.com> Co-authored-by: Mohamed El Mahallawy <mmahalwy@gmail.com> Co-authored-by: Dillon Mulroy <dillon.mulroy@gmail.com> Co-authored-by: Carmelo Scandaliato <8927157+cascandaliato@users.noreply.github.com> Co-authored-by: Aishah <aissshah@outlook.com> Co-authored-by: Samson Zhang <wwsamson@yahoo.com> Co-authored-by: Vova <volodimir.partytskyi@gmail.com> Co-authored-by: Cody Ogden <cody@codyogden.com> Co-authored-by: geraldm74 <gerald_mcnicholl@yahoo.com> Co-authored-by: Gerald McNicholl <gerald.mcnicholl@xero.com> Co-authored-by: Jeremy Caine <jezcaine@gmail.com> Co-authored-by: Matthew Graser <mdgraser@gmail.com> Co-authored-by: mgraser <matt.graser@mlb.com> Co-authored-by: Kristofor Carle <kris@maphubs.com> Co-authored-by: Archit Khode <arkits@outlook.com> Co-authored-by: Archit Khode <archit.khode@gmail.com> Co-authored-by: Daniel Gadd <danielgadd@outlook.com> Co-authored-by: Robert Hufsky <Robert.Hufsky@gmx.net>
Adds support for FaunaDB as a database adapter.
I have attempted to mimic the existing adapter implementations, whilst still keeping to the Fauna style where possible. Fauna refs are used to reference related data, although I have opted for storing just the 'id' rather than a ref object. All timestamps are stored as Time objects in UTC (not sure if this will cause any problems down the line?).
I am not very experienced with Fauna and FQL, so if anyone does have suggestions, I am all ears :-)
There is some initial setup required by the user to create collections and indexes, although I was not sure if this could be fit into the
syncrhonize
option somehow.