diff --git a/src/lib/server/secret.ts b/src/lib/server/secret.ts index 23fcff4..8013a02 100644 --- a/src/lib/server/secret.ts +++ b/src/lib/server/secret.ts @@ -7,11 +7,12 @@ export async function validateSecret(secret: string): Promise { throw new Error('Invalid secret'); } + const secretEnv = env.SECRET; // Assert that the secret env exists - if (env.SECRET === null || env.SECRET === undefined || env.SECRET === '') { + if (secretEnv === null || secretEnv === undefined || secretEnv === '') { throw new Error('SECRET env is not defined or empty string'); } - const secretHash = await hashPassword(env.SECRET); + const secretHash = await hashPassword(secretEnv); return await verifyPasswordHash(secretHash, secret); }