moved page rendering to a different service and access is now behind
admin.DOMAIN www.DOMAIN db.DOMAIN
This commit is contained in:
parent
c7f6b30b87
commit
1027da989e
126 changed files with 6356 additions and 1516 deletions
15
app-public/src/hooks.server.ts
Normal file
15
app-public/src/hooks.server.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import type { Handle } from '@sveltejs/kit';
|
||||
import { env } from '$env/dynamic/private';
|
||||
import { createPocketBase } from '$lib/pb';
|
||||
|
||||
export const handle: Handle = async ({ event, resolve }) => {
|
||||
event.locals.pb = createPocketBase(
|
||||
event.request.headers.get('cookie') ?? '',
|
||||
env.POCKETBASE_INTERNAL_URL
|
||||
);
|
||||
event.locals.user = event.locals.pb.authStore.record;
|
||||
|
||||
const response = await resolve(event);
|
||||
response.headers.append('set-cookie', event.locals.pb.authStore.exportToCookie({ sameSite: 'lax' }, 'pb_auth'));
|
||||
return response;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue