Next.js Discord

Discord Forum

"Error: This action with HTTP GET is not supported." After upgrading auth.js beta 5 to 9

Answered
Plott Hound posted this in #help-forum
Open in Discord
Plott HoundOP
On signing in or out i get the error: "Error: This action with HTTP GET is not supported." at http://localhost:3000/api/auth/error

this was working great until i updated.

I'm using auth with prisma adapter and postgres.

/app/api/auth/[...nextauth]/route.ts:
export { GET, POST } from "@/auth";


/auth.ts:
import NextAuth from "next-auth"
import { PrismaAdapter } from "@auth/prisma-adapter"
import prisma from "@/db/prisma";
import authConfig from "@/auth.config"

export const {
  handlers: { GET, POST },
  auth,
} = NextAuth({
  adapter: PrismaAdapter(prisma),
  ...authConfig,
});

NextJS 14.1.0
AuthJS 5 beta 9
Prisma 5.9.1
@auth/prisma-adapter 1.3.3
Answered by Plott Hound
gave up and rolled back to beta 4
View full answer

6 Replies

Plott HoundOP
/auth.config.ts
import GitHub from "next-auth/providers/github";
import type { NextAuthConfig, Session } from "next-auth";
import type { JWT } from "next-auth/jwt";
import type { User } from "next-auth";

export default {
  providers: [
    GitHub({
      clientId: process.env.GITHUB_ID,
      clientSecret: process.env.GITHUB_SECRET,
    }),
  ],
  session: { strategy: "jwt" },
  callbacks: {
    jwt: async ({ user, token }) => {
      if (user) {
        token.uid = user.id;
      }
      return token;
    },
    session: async ({ session, token }: { session: Session; token: JWT }) => {
      if (session?.user) {
        (session.user as User).id = token.uid as string;
      }
      return session;
    },
  }
} as NextAuthConfig;
.env:
AUTH_URL="http://localhost:3000"
AUTH_SECRET="..."
console error:
[auth][error] UnknownAction: Cannot parse action at /api/auth/signin .Read more at https://errors.authjs.dev#unknownaction
Plott HoundOP
gave up and rolled back to beta 4
Answer
@Plott Hound gave up and rolled back to beta 4
Donskoy
I have the same problem after upgrading to NextJS 14.1.0 and NextAuth 5.0.0 Beta 9. Has anybody else a solution?
Plott HoundOP
no and i havent seen anything about it on github issues either. very strange