Next.js Discord

Discord Forum

cookie throw 404 when accessed from prod:

Unanswered
AM posted this in #help-forum
Open in Discord
AMOP
I have these 2 actions:

export async function signInAction({ jwt }: { jwt: string }) {
  cookies().set(COOKIE_KEYS.JWT, jwt, { secure: true });
}


and:

export async function isAuthAction() {
  const jwt = cookies().get(COOKIE_KEYS.JWT)?.value;

  return { isAuth: Boolean(jwt) };
}


on localhost they work fine but on prod they throw 404

3 Replies

AMOP
and not really able to reproduce locally
AMOP
next@14.2.2
what's the response?