mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
16 lines
502 B
TypeScript
16 lines
502 B
TypeScript
import { ProjectShareModel } from "~/shared/schema/project/ProjectShareSchema";
|
|
|
|
|
|
|
|
export default defineEventHandler(async event => {
|
|
const ctx = await getRequestContext(event, 'flag:allowAnon');
|
|
const { linkId } = getQuery(event)
|
|
const target = await ProjectShareModel.findOne({
|
|
link: linkId?.toString()
|
|
});
|
|
if (!target) return;
|
|
return {
|
|
project_id: target.project_id,
|
|
hasPassword: (target.password != undefined && target.password.length > 0)
|
|
}
|
|
});
|