fix: Phase 5 - fix environment variable imports (38 -> 37 errors)
Resolved PUBLIC_SIERO_OAUTH_URL import issue by removing the intermediate
config.ts file and importing environment variables directly where needed.
Changes:
- Removed src/lib/config.ts (unnecessary abstraction layer)
- Updated src/lib/auth/oauth.ts to import PUBLIC_SIERO_API_URL directly
- Updated src/routes/auth/refresh/+server.ts to import directly
- Construct OAUTH_BASE locally as `${PUBLIC_SIERO_API_URL}/oauth`
This fixes the TypeScript error where svelte-check couldn't resolve
PUBLIC_SIERO_OAUTH_URL from the config file, even though the variable
was properly defined in .env and .svelte-kit/ambient.d.ts.
Result: 38 → 37 errors (-1)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
7caa34452f
commit
ebc0e48e92
3 changed files with 6 additions and 6 deletions
|
|
@ -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 {
|
export interface OAuthLoginResponse {
|
||||||
access_token: string
|
access_token: string
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { RequestHandler } from '@sveltejs/kit'
|
import type { RequestHandler } from '@sveltejs/kit'
|
||||||
import { json } from '@sveltejs/kit'
|
import { json } from '@sveltejs/kit'
|
||||||
import { OAUTH_BASE } from '$lib/config'
|
import { PUBLIC_SIERO_API_URL } from '$env/static/public'
|
||||||
import {
|
import {
|
||||||
getRefreshFromCookies,
|
getRefreshFromCookies,
|
||||||
setAccountCookie,
|
setAccountCookie,
|
||||||
|
|
@ -8,6 +8,8 @@ import {
|
||||||
clearAuthCookies
|
clearAuthCookies
|
||||||
} from '$lib/auth/cookies'
|
} from '$lib/auth/cookies'
|
||||||
|
|
||||||
|
const OAUTH_BASE = `${PUBLIC_SIERO_API_URL}/oauth`
|
||||||
|
|
||||||
type OAuthRefreshResponse = {
|
type OAuthRefreshResponse = {
|
||||||
access_token: string
|
access_token: string
|
||||||
token_type: 'Bearer'
|
token_type: 'Bearer'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue