diff --git a/src/lib/auth/oauth.ts b/src/lib/auth/oauth.ts index a9a4c16c..d13d05da 100644 --- a/src/lib/auth/oauth.ts +++ b/src/lib/auth/oauth.ts @@ -1,4 +1,6 @@ -import { OAUTH_BASE } from '$lib/config' +import { PUBLIC_SIERO_API_URL } from '$env/static/public' + +const OAUTH_BASE = `${PUBLIC_SIERO_API_URL}/oauth` export interface OAuthLoginResponse { access_token: string diff --git a/src/lib/config.ts b/src/lib/config.ts deleted file mode 100644 index e58ca965..00000000 --- a/src/lib/config.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { PUBLIC_SIERO_OAUTH_URL } from '$env/static/public' - -// Single source of truth for env-based URLs -export const OAUTH_BASE = PUBLIC_SIERO_OAUTH_URL diff --git a/src/routes/auth/refresh/+server.ts b/src/routes/auth/refresh/+server.ts index 0ae1ffb0..e537c3d7 100644 --- a/src/routes/auth/refresh/+server.ts +++ b/src/routes/auth/refresh/+server.ts @@ -1,6 +1,6 @@ import type { RequestHandler } from '@sveltejs/kit' import { json } from '@sveltejs/kit' -import { OAUTH_BASE } from '$lib/config' +import { PUBLIC_SIERO_API_URL } from '$env/static/public' import { getRefreshFromCookies, setAccountCookie, @@ -8,6 +8,8 @@ import { clearAuthCookies } from '$lib/auth/cookies' +const OAUTH_BASE = `${PUBLIC_SIERO_API_URL}/oauth` + type OAuthRefreshResponse = { access_token: string token_type: 'Bearer'