Skip to content

Commit

Permalink
fix: Prevent /api requests from being redirected to /onboarding (#140)
Browse files Browse the repository at this point in the history
Prevent /api requests from being redirected to /onboarding

This aims to fix the issue described in #139
  • Loading branch information
ZDTaylor authored Oct 19, 2024
1 parent 633caf9 commit bd25da1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const setLocals: Handle = async ({ event, resolve }) => {
};

const onboarding: Handle = async ({ event, resolve }) => {
if (!event.url.pathname.startsWith('/onboarding') && event.request.method === 'GET') {
if (!(event.url.pathname.startsWith('/onboarding') || event.url.pathname.startsWith('/api')) && event.request.method === 'GET') {
const { data, error: apiError } = await DefaultService.services();
if (apiError || !data) {
return error(500, 'API Error');
Expand Down

0 comments on commit bd25da1

Please sign in to comment.