nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
24.1k stars 3.34k forks source link

Firebase Adapter `GetUserByAccountError` Error on login #9123

Closed happer64bit closed 10 months ago

happer64bit commented 10 months ago

Adapter type

@auth/firebase-adapter

Environment

System: OS: Windows 11 10.0.22631 CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz Memory: 6.05 GB / 15.82 GB Binaries: Node: 20.6.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD npm: 9.6.4 - C:\Program Files\nodejs\npm.CMD pnpm: 8.9.0 - ~\AppData\Roaming\npm\pnpm.CMD Browsers: Edge: Chromium (119.0.2151.58) Internet Explorer: 11.0.22621.1

npmPackages: next: 14.0.2 => 14.0.2 next-auth: ^4.24.5 => 4.24.5 react: ^18 => 18.2.0

npmPackages: @auth/firebase-adapter: ^1.0.4 => 1.0.4

Reproduction URL

...

Describe the issue

When I try to login I got error

[next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR] 
https://next-auth.js.org/errors#oauth_callback_handler_error Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information. Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.
    at GoogleAuth.getApplicationDefaultAsync (C:\Users\happer\Projects\appsmap\node_modules\google-auth-library\build\src\auth\googleauth.js:207:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async GoogleAuth.getClient (C:\Users\happer\Projects\appsmap\node_modules\google-auth-library\build\src\auth\googleauth.js:624:17)
    at async GrpcClient._getCredentials (C:\Users\happer\Projects\appsmap\node_modules\google-gax\build\src\grpc.js:145:24)
    at async GrpcClient.createStub (C:\Users\happer\Projects\appsmap\node_modules\google-gax\build\src\grpc.js:308:23)
Caused by: Error
    at Query._get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1738:23)
    at Query.get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1726:21)
    at getOneDoc (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:256:52)
    at getUserByAccount (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:123:35)
    at _callee2$ (webpack-internal:///(rsc)/./node_modules/next-auth/core/errors.js:301:43)
    at tryCatch (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:36:24)
    at Generator.eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:123:25)
    at Generator.eval [as next] (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:64:29)
    at asyncGeneratorStep (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:4:28)
    at _next (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:17)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:13)
    at new Promise (<anonymous>)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:16)
    at Object.callback (webpack-internal:///(rsc)/./node_modules/next-auth/core/routes/callback.js:42:49)
    at async AuthHandler (webpack-internal:///(rsc)/./node_modules/next-auth/core/index.js:202:38)
    at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:50:30)
    at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:85:24)
    at async C:\Users\happer\Projects\appsmap\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:62591
Caused by: Error
    at Query._get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1738:23)
    at Query.get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1726:21)
    at getOneDoc (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:256:52)
    at getUserByAccount (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:123:35)
    at _callee2$ (webpack-internal:///(rsc)/./node_modules/next-auth/core/errors.js:301:43)
    at tryCatch (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:36:24)
    at Generator.eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:123:25)
    at Generator.eval [as next] (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:64:29)
    at asyncGeneratorStep (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:4:28)
    at _next (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:17)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:13)
    at new Promise (<anonymous>)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:16)
    at Object.callback (webpack-internal:///(rsc)/./node_modules/next-auth/core/routes/callback.js:42:49)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async AuthHandler (webpack-internal:///(rsc)/./node_modules/next-auth/core/index.js:202:38)
    at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:50:30)
    at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:85:24)
    at async C:\Users\happer\Projects\appsmap\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:62591
Caused by: Error
    at Query._get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1738:23)
    at Query.get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1726:21)
    at getOneDoc (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:256:52)
    at getUserByAccount (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:123:35)
    at _callee2$ (webpack-internal:///(rsc)/./node_modules/next-auth/core/errors.js:301:43)
    at tryCatch (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:36:24)
    at Generator.eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:123:25)
    at Generator.eval [as next] (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:64:29)
    at asyncGeneratorStep (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:4:28)
    at _next (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:17)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:13)
    at new Promise (<anonymous>)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:16)
    at Object.callback (webpack-internal:///(rsc)/./node_modules/next-auth/core/routes/callback.js:42:49)
    at async AuthHandler (webpack-internal:///(rsc)/./node_modules/next-auth/core/index.js:202:38)
    at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:50:30)
    at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:85:24)
    at async C:\Users\happer\Projects\appsmap\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:62591
Caused by: Error
    at Query._get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1738:23)
    at Query.get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1726:21)
    at getOneDoc (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:256:52)
    at getUserByAccount (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:123:35)
    at _callee2$ (webpack-internal:///(rsc)/./node_modules/next-auth/core/errors.js:301:43)
    at tryCatch (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:36:24)
    at Generator.eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:123:25)
    at Generator.eval [as next] (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:64:29)
    at asyncGeneratorStep (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:4:28)
    at _next (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:17)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:13)
    at new Promise (<anonymous>)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:16)
    at Object.callback (webpack-internal:///(rsc)/./node_modules/next-auth/core/routes/callback.js:42:49)
    at async AuthHandler (webpack-internal:///(rsc)/./node_modules/next-auth/core/index.js:202:38)
    at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:50:30)
    at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:85:24)
    at async C:\Users\happer\Projects\appsmap\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:62591
Caused by: Error
    at Query._get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1738:23)
    at Query.get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1726:21)
    at getOneDoc (webpack-internal:///(rsc)/./node_modules/@next-auth/firebase-adapter/index.js:267:52)
    at getUserByAccount (webpack-internal:///(rsc)/./node_modules/@next-auth/firebase-adapter/index.js:134:35)
    at _callee2$ (webpack-internal:///(rsc)/./node_modules/next-auth/core/errors.js:301:43)
    at tryCatch (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:36:24)
    at Generator.eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:123:25)
    at Generator.eval [as next] (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:64:29)
    at asyncGeneratorStep (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:4:28)
    at _next (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:17)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:13)
    at new Promise (<anonymous>)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:16)
    at Object.callback (webpack-internal:///(rsc)/./node_modules/next-auth/core/routes/callback.js:42:49)
    at async AuthHandler (webpack-internal:///(rsc)/./node_modules/next-auth/core/index.js:202:38)
    at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:50:30)
    at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:85:24)
    at async C:\Users\happer\Projects\appsmap\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:62591
Caused by: Error
    at Query._get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1738:23)
    at Query.get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1726:21)
    at getOneDoc (webpack-internal:///(rsc)/./node_modules/@next-auth/firebase-adapter/index.js:267:52)
    at getUserByAccount (webpack-internal:///(rsc)/./node_modules/@next-auth/firebase-adapter/index.js:134:35)
    at _callee2$ (webpack-internal:///(rsc)/./node_modules/next-auth/core/errors.js:301:43)
    at tryCatch (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:36:24)
    at Generator.eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:123:25)
    at Generator.eval [as next] (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:64:29)
    at asyncGeneratorStep (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:4:28)
    at _next (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:17)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:13)
    at new Promise (<anonymous>)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:16)
    at Object.callback (webpack-internal:///(rsc)/./node_modules/next-auth/core/routes/callback.js:42:49)
    at async AuthHandler (webpack-internal:///(rsc)/./node_modules/next-auth/core/index.js:202:38)
    at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:50:30)
    at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:85:24)
    at async C:\Users\happer\Projects\appsmap\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:62591
Caused by: Error
    at Query._get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1738:23)
    at Query.get (C:\Users\happer\Projects\appsmap\node_modules\@google-cloud\firestore\build\src\reference.js:1726:21)
    at getOneDoc (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:256:52)
    at getUserByAccount (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:123:35)
    at _callee2$ (webpack-internal:///(rsc)/./node_modules/next-auth/core/errors.js:301:43)
    at tryCatch (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:36:24)
    at Generator.eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:123:25)
    at Generator.eval [as next] (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:64:29)
    at asyncGeneratorStep (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:4:28)
    at _next (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:17)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:13)
    at new Promise (<anonymous>)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:16)
    at Object.callback (webpack-internal:///(rsc)/./node_modules/next-auth/core/routes/callback.js:42:49)
    at async AuthHandler (webpack-internal:///(rsc)/./node_modules/next-auth/core/index.js:202:38)
    at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:50:30)
    at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:85:24)
    at async C:\Users\happer\Projects\appsmap\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:62591 {
  name: 'GetUserByAccountError',
  code: undefined

How to reproduce

idk

Expected behavior

Login Success

github-actions[bot] commented 10 months ago

We could not detect a valid reproduction link. Make sure to follow the bug report template carefully.

Why was this issue closed?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We need a link to a public GitHub repository. Example: (NextAuth.js example repository).

The bug template that you filled out has a section called "Reproduction URL", which is where you should provide the link to the reproduction.

What should I do?

Depending on the reason the issue was closed, you can do the following:

In general, assume that we should not go through a lengthy onboarding process at your company code only to be able to verify an issue.

My repository is private and cannot make it public

In most cases, a private repo will not be a sufficient minimal reproduction, as this codebase might contain a lot of unrelated parts that would make our investigation take longer. Please do not make it public. Instead, create a new repository using the templates above, adding the relevant code to reproduce the issue. Common things to look out for:

I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps by opening a new issue.

I think my reproduction is good enough, why aren't you looking into it quickly?

We look into every issue and monitor open issues for new comments.

However, sometimes we might miss a few due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

Useful Resources