mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
Last Login saved & Success Messages
This commit is contained in:
@@ -39,6 +39,17 @@ export async function POST(request: NextRequest) {
|
||||
|
||||
const token = jwt.sign({ id: user.id }, process.env.JWT_SECRET, { expiresIn: body.remember ? "7d" : "1h" });
|
||||
|
||||
const lastLogin = new Date();
|
||||
|
||||
await prisma.user.update({
|
||||
where: {
|
||||
id: user.id,
|
||||
},
|
||||
data: {
|
||||
lastLogin,
|
||||
},
|
||||
});
|
||||
|
||||
return NextResponse.json({ message: "Login successful", token }, { status: 200 });
|
||||
|
||||
} catch (error: any) {
|
||||
|
||||
Reference in New Issue
Block a user