fixed api path error

This commit is contained in:
rykuno 2024-09-12 17:30:04 -05:00
parent b33590edad
commit f5016aeb1a
5 changed files with 28 additions and 27 deletions

3
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"vitest.disableWorkspaceWarning": true
}

View file

@ -32,7 +32,6 @@ services:
mailpit:
image: axllent/mailpit
container_name: mailpit
restart: unless-stopped
volumes:
- mailpit_data:/data
ports:

View file

@ -18,12 +18,12 @@ const apiClient: Handle = async ({ event, resolve }) => {
/* ----------------------------- Auth functions ----------------------------- */
async function getAuthedUser() {
const { data } = await api.users.me.$get().then(parseApiResponse)
const { data } = await api.iam.me.$get().then(parseApiResponse)
return data && data.user;
}
async function getAuthedUserOrThrow(redirectTo = '/') {
const { data } = await api.users.me.$get().then(parseApiResponse);
const { data } = await api.iam.me.$get().then(parseApiResponse);
if (!data || !data.user) throw redirect(StatusCodes.TEMPORARY_REDIRECT, redirectTo);
return data?.user;
}

View file

@ -32,4 +32,3 @@ export class WelcomeEmail implements Email {
`;
}
}