mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
Remove VITE_SERVER_ENDPOINT dependency (#428)
* Move backend api to its own instance * Remove external fetch hook * Added endpoint for album * Added endpoint for admin page * Make request directly to immich-server * Refactor unsued code
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { ExternalFetch, GetSession, Handle } from '@sveltejs/kit';
|
||||
import * as cookie from 'cookie';
|
||||
import { api } from '@api';
|
||||
import { api, serverApi } from '@api';
|
||||
|
||||
export const handle: Handle = async ({ event, resolve }) => {
|
||||
const cookies = cookie.parse(event.request.headers.get('cookie') || '');
|
||||
@@ -11,8 +11,8 @@ export const handle: Handle = async ({ event, resolve }) => {
|
||||
const accessToken = cookies['immich_access_token'];
|
||||
|
||||
try {
|
||||
api.setAccessToken(accessToken);
|
||||
const { data } = await api.userApi.getMyUserInfo();
|
||||
serverApi.setAccessToken(accessToken);
|
||||
const { data } = await serverApi.userApi.getMyUserInfo();
|
||||
event.locals.user = data;
|
||||
|
||||
return await resolve(event);
|
||||
|
||||
Reference in New Issue
Block a user