adds upload dialog and duplicates

This commit is contained in:
Christian Beutel
2025-02-01 18:06:27 +01:00
parent ae3ef0e0a1
commit 0cf17cbd86
25 changed files with 499 additions and 147 deletions

View File

@@ -67,7 +67,7 @@ const auth: Handle = async ({ event, resolve }) => {
try {
// get an up-to-date auth store state by verifying and refreshing the loaded auth model (if any)
if (pb.authStore.isValid) {
await pb.collection('users').authRefresh()
await pb.collection('users').authRefresh({requestKey: null})
}
} catch (_) {
// clear the auth store on failed refresh
@@ -78,7 +78,7 @@ const auth: Handle = async ({ event, resolve }) => {
let settings: Settings | undefined;
if (pb.authStore.model) {
meiliApiKey = pb.authStore.model.token
settings = await pb.collection('settings').getFirstListItem<Settings>(`user="${pb.authStore.model.id}"`)
settings = await pb.collection('settings').getFirstListItem<Settings>(`user="${pb.authStore.model.id}"`, {requestKey: null})
} else {
const r = await event.fetch(pb.buildUrl("/public/search/token"));
const response = await r.json();
@@ -111,4 +111,12 @@ const auth: Handle = async ({ event, resolve }) => {
return response
}
export const handle = sequence(csrf(['/api/v1']), auth)
const removeLinkFromHeaders: Handle =
async ({ event, resolve }) => {
const response = await resolve(event);
response.headers.delete('link');
return response;
}
export const handle = sequence(csrf(['/api/v1']), auth, removeLinkFromHeaders)