Skip to content

Commit

Permalink
fix: fix not adding apiUrlEnv to locals
Browse files Browse the repository at this point in the history
  • Loading branch information
duruer committed Jan 23, 2025
1 parent 8d3d991 commit 5c8326e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hooks.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ export async function handle({
}) {
const locals = {};

const jwt = cookies.get(COOKIE_PREFIX + JWT_COOKIE_NAME);
const csrfToken = cookies.get(COOKIE_PREFIX + CSRF_TOKEN_COOKIE_NAME);

// noinspection JSUnresolvedReference
const apiUrlEnv = process.env.API_URL;

if (apiUrlEnv) {
updateApiUrl(apiUrlEnv);
locals.apiUrlEnv = apiUrlEnv;
}

const jwt = cookies.get(COOKIE_PREFIX + JWT_COOKIE_NAME);
const csrfToken = cookies.get(COOKIE_PREFIX + CSRF_TOKEN_COOKIE_NAME);

locals.user =
jwt && csrfToken &&
!pathname.startsWith("/api/") &&
Expand Down

0 comments on commit 5c8326e

Please sign in to comment.