Skip to content

Commit 1c3ccf8

Browse files
committed
fix(secret): const env
1 parent da6cfd3 commit 1c3ccf8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/server/secret.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ export async function validateSecret(secret: string): Promise<boolean> {
77
throw new Error('Invalid secret');
88
}
99

10+
const secretEnv = env.SECRET;
1011
// Assert that the secret env exists
11-
if (env.SECRET === null || env.SECRET === undefined || env.SECRET === '') {
12+
if (secretEnv === null || secretEnv === undefined || secretEnv === '') {
1213
throw new Error('SECRET env is not defined or empty string');
1314
}
1415

15-
const secretHash = await hashPassword(env.SECRET);
16+
const secretHash = await hashPassword(secretEnv);
1617
return await verifyPasswordHash(secretHash, secret);
1718
}

0 commit comments

Comments
 (0)