Skip to content

Commit

Permalink
fix: make env vars dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
sverben committed Dec 24, 2024
1 parent adaf1cb commit 89e9564
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/lib/server/auth0.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { JwksClient } from 'jwks-rsa';
import { AUTH0_CLIENT_ID, AUTH0_ISSUER, ORIGIN } from '$env/static/private';
import { randomBytes } from 'crypto';
import { redirect } from '@sveltejs/kit';
import { env } from '$env/dynamic/private';
import { importJWK, type KeyLike } from 'jose';

const { AUTH0_CLIENT_ID, AUTH0_ISSUER, ORIGIN } = env;
let CACHE_KEY: KeyLike | Uint8Array | null = null;

export async function getKey() {
Expand Down
5 changes: 3 additions & 2 deletions src/routes/callback/+server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { RequestHandler } from './$types';
import { AUTH0_CLIENT_ID, AUTH0_CLIENT_SECRET, AUTH0_ISSUER, ORIGIN } from '$env/static/private';
import { redirect } from '@sveltejs/kit';
import { env } from '$env/dynamic/private';

const { AUTH0_CLIENT_ID, AUTH0_CLIENT_SECRET, AUTH0_ISSUER, ORIGIN } = env;

export const GET: RequestHandler = async ({ url, cookies }) => {
const code = url.searchParams.get('code');
Expand Down

0 comments on commit 89e9564

Please sign in to comment.