mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
new selfhosted version
This commit is contained in:
11
dashboard/server/api/share/verify.ts
Normal file
11
dashboard/server/api/share/verify.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { ProjectShareModel } from "~/shared/schema/project/ProjectShareSchema";
|
||||
|
||||
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
const ctx = await getRequestContext(event, 'flag:allowAnon');
|
||||
const { linkId, password } = getQuery(event)
|
||||
const target = await ProjectShareModel.findOne({ link: linkId?.toString(), password: password?.toString() });
|
||||
if (!target) return false;
|
||||
return true;
|
||||
});
|
||||
Reference in New Issue
Block a user