nextauthjs / next-auth

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

jwt error #8325

Closed avnav0 closed 1 year ago

avnav0 commented 1 year ago

Environment

  System:
    OS: Linux 5.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (8) x64 Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
    Memory: 10.69 GB / 12.42 GB
    Container: Yes
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 20.5.0 - /usr/bin/node
    npm: 9.8.1 - /usr/bin/npm

Reproduction URL

not possible

Describe the issue

jakey@mnymkr:~/itys$ npm run push

> itys@0.0.1 push
> drizzle-kit push:sqlite

No config path provided, using default 'drizzle.config.ts'
Reading config file '/home/jakey/itys/drizzle.config.ts'
drizzle-kit: v0.19.12
drizzle-orm: v0.27.2

/home/jakey/itys/node_modules/drizzle-kit/index.cjs:48352
    return new LibsqlError(e.message, code, e);
           ^

LibsqlError: AUTH_JWT_INVALID: Authentication failed: The JWT is invalid
    at mapHranaError (/home/jakey/itys/node_modules/drizzle-kit/index.cjs:48352:12)
    at HranaClient.execute (/home/jakey/itys/node_modules/drizzle-kit/index.cjs:48392:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async TursoSqlite.query (/home/jakey/itys/node_modules/drizzle-kit/index.cjs:42851:21)
    at async fromDatabase3 (/home/jakey/itys/node_modules/drizzle-kit/index.cjs:12875:23)
    at async sqlitePushIntrospect (/home/jakey/itys/node_modules/drizzle-kit/index.cjs:51860:19)
    at async Command.<anonymous> (/home/jakey/itys/node_modules/drizzle-kit/index.cjs:53318:31) {
  code: 'AUTH_JWT_INVALID',
  [cause]: [ResponseError: Authentication failed: The JWT is invalid] {
    code: 'AUTH_JWT_INVALID',
    proto: {
      message: 'Authentication failed: The JWT is invalid',
      code: 'AUTH_JWT_INVALID'
    }
  }
}

How to reproduce

trying to push the generated schema, but have a jwt issue.

Expected behavior

to be able to push to the turso db.

github-actions[bot] commented 1 year ago

We cannot recreate the issue with the provided information. Please add a reproduction in order for us to be able to investigate.

Why was this issue marked with the incomplete label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository (template), but you can also use a tool like CodeSandbox or StackBlitz.

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue.

Please test your reproduction against the latest version of NextAuth.js (next-auth@latest) to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

What happens if I don't provide a sufficient minimal reproduction?

Issues with the incomplete label that receives no meaningful activity (e.g. new comments with a reproduction link) are closed after 7 days.

If your issue has not been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction. (It's less likely that we check back on already closed issues.)

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. Furthermore, you can upvote the issue using the :+1: reaction on the topmost comment (please do not comment "I have the same issue" without repro steps). Then, we can sort issues by votes to prioritize.

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

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

However, sometimes we might miss one or two. 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

sahilshahane commented 1 year ago

I'm getting similar error, it should automatically clear your cookies and redirect to signin but it's not doing that

image

avnav0 commented 1 year ago

i created a new db token and it took care of it