+ Password Change, +- Settings NAV, fixed bg missing

This commit is contained in:
Nicolas
2025-02-17 02:16:13 +01:00
parent 6c67a11cab
commit ad69d144e5
9 changed files with 167 additions and 66 deletions

View File

@@ -0,0 +1,30 @@
"use server";
import { Prisma, PrismaClient } from "@repo/db";
import { getServerSession } from "../../api/auth/[...nextauth]/auth";
export const unlinkDiscord = async (userId: string) => {
const client = new PrismaClient();
await client.discordAccount.deleteMany({
where: {
userId,
},
});
};
export const updateUser = async (changes: Prisma.UserUpdateInput) => {
const session = await getServerSession();
if (!session) return null;
const client = new PrismaClient();
await client.user.update({
where: {
id: session.user.id,
},
data: changes,
});
};
export const changePassword = async (changes: Prisma.UserUpdateInput) => {
// TODO: Add password change logic
};