mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
10 lines
358 B
TypeScript
10 lines
358 B
TypeScript
|
|
import { PasswordModel } from "@schema/PasswordSchema";
|
|
|
|
export default defineEventHandler(async event => {
|
|
const userData = getRequestUser(event);
|
|
if (!userData?.logged) return;
|
|
const hasPassword = await PasswordModel.exists({ email: userData.user.email });
|
|
if (hasPassword) return { can_change: true };
|
|
return { can_change: false }
|
|
}); |