feat
Deskripsi: - Create validasi - Create register - create global prisma, color tune,dan global state
This commit is contained in:
20
src/app/api/auth/login/route.ts
Normal file
20
src/app/api/auth/login/route.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { MyConsole } from "@/app/fun/my_console";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
if (req.method === "POST") {
|
||||
const body = await req.json();
|
||||
MyConsole(body);
|
||||
|
||||
try {
|
||||
await fetch(
|
||||
`https://wa.wibudev.com/code?nom=${body.nomor}&text=${body.otp}`
|
||||
);
|
||||
return NextResponse.json({ body, status: 200, message: "Login Success" });
|
||||
} catch (error) {
|
||||
return NextResponse.json({ status: 500, message: "Server Error !!!" });
|
||||
}
|
||||
}
|
||||
return NextResponse.json({ success: false });
|
||||
}
|
||||
Reference in New Issue
Block a user