Nextauth unexpected token
Answered
Mike posted this in #help-forum

Answered by Ray
You should export GET and POST functions on app/api/auth/[…nextauth]/route.js
7 Replies

MikeOP
i also tried it with a [...nextauth] folder and a route.js inside

MikeOP


@Mike Click to see attachment

MikeOP
this is how my rootlayout looks
import { SessionProvider } from "next-auth/react";
import React, { ReactNode } from "react";
function Provider({ children }) {
return <SessionProvider>{children}</SessionProvider>;
}
export default Provider;
This is my provider

@Mike Click to see attachment

You should export GET and POST functions on app/api/auth/[…nextauth]/route.js
Answer

MikeOP
I have done it thank you very much 🙂