Next.js Discord

Discord Forum

MissingCSRF: CSRF token was missing during an action signin

Unanswered
Manx posted this in #help-forum
Open in Discord
ManxOP
I have the auth secre t set using the command:auth secret

This is the provider I'm using, secrets are set correctly.
    DiscordProvider({
      clientId: env.DISCORD_CLIENT_ID,
      clientSecret: env.DISCORD_CLIENT_SECRET,
    }),


The error messages points me to this page: https://authjs.dev/reference/core/errors#missingcsrf

How do I debug this?

[edit]
I removed 2nd argument in the adapter method and got a different behavior:
From:
  adapter: DrizzleAdapter(db, {
    usersTable: users,
    accountsTable: accounts,
    sessionsTable: sessions,
    verificationTokensTable: verificationTokens,
  }) as Adapter,

To:
  adapter: DrizzleAdapter(db) as Adapter,


New behavior: Redirected me to Github's auth page with the json response: {"client_id": ["Value \"Ov23li5thBFFAKEDWAq5G\" is not snowflake."]}

Am I setting those tables incorrectly, I got those from T3-stack default steup.

1 Reply

Short-tailed Albatross
any chance i could get to speak to you on how you handled your missing csrf?