Error using next Auth
Unanswered
Shiny Cowbird posted this in #help-forum
Shiny CowbirdOP
was just following this guide: https://authjs.dev/getting-started/installation?framework=Next.js
and was getting this error:
Its just basic code straight from the guide, idk where its wrong
and was getting this error:
TypeError: (0 , {imported module [project]/src/auth.js [app-rsc] (ecmascript)}.signIn) is not a function
// @/app/api/auth/[...nextauth]/route.js
import { handlers } from "@/auth"
export const { GET, POST } = handlers
// @/auth.js
import NextAuth from "next-auth"
import Google from "next-auth/providers/google"
export const { handlers, signIn, signOut, auth } = NextAuth({
providers: [Google],
})
// @/signup/page.js
import { signIn } from "@/auth"
export default function SignIn() {
return (
<form
action={async () => {
"use server"
await signIn("google")
}}
>
<button type="submit">Signin with Google</button>
</form>
)
}
Its just basic code straight from the guide, idk where its wrong
1 Reply
Shiny CowbirdOP
Anyone?