Skip to content

next auth problem login hocce na #3

@Shipon-Roy

Description

@Shipon-Roy

//aita error dekhacce
[ Server ] Error: Read more at https://errors.authjs.dev#callbackrouteerror

export async function doCredentialLogin(formData) {
11 | try {

12 | const response = await signIn("credentials", { // error dekhacce ekhane
| ^
13 | email: formData.get("email"),
14 | password: formData.get("password"),
15 | redirect: true,

"use server";

import { signIn, signOut } from "@/auth";
import { revalidatePath } from "next/cache";

export async function doLogout() {
await signOut({ redirectTo: "/" });
}

export async function doCredentialLogin(formData) {
try {
const response = await signIn("credentials", {
email: formData.get("email"),
password: formData.get("password"),
redirect: true,
});
revalidatePath("/");
return response;
} catch (err) {
console.error("Login error:", err);
throw err;
}
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions