Settings manages folders, thumbnail defaults, and passwords for the signed-in account, and choosing an image now browses saved stills instead of only the desktop file dialog. Co-authored-by: Cursor <cursoragent@cursor.com>
12 lines
565 B
TypeScript
12 lines
565 B
TypeScript
export default defineEventHandler(async (event) => {
|
|
const { owner } = assertLibraryOwner(event)
|
|
const body = await readBody<{ password?: string; folderId?: string }>(event)
|
|
const password = String(body?.password || '')
|
|
if (!password) {
|
|
throw createError({ statusCode: 400, statusMessage: 'Password is required' })
|
|
}
|
|
const unlocked = await unlockMatchingFolders(owner, password, body?.folderId)
|
|
setFolderUnlocks(event, Object.fromEntries(unlocked.map(folder => [folder.id, passwordVersion(folder.passwordHash)])))
|
|
return publicLibrary(event)
|
|
})
|