( env: NodeJS.ProcessEnv = process.env, )
| 5 | const BCRYPT_COST = 12; |
| 6 | |
| 7 | export async function resolvePasswordHash( |
| 8 | env: NodeJS.ProcessEnv = process.env, |
| 9 | ): Promise<string | undefined> { |
| 10 | const plaintext = env['KIMI_CODE_PASSWORD']; |
| 11 | if (!plaintext) { |
| 12 | return undefined; |
| 13 | } |
| 14 | return hash(plaintext, BCRYPT_COST); |
| 15 | } |
| 16 | |
| 17 | export async function verifyPassword( |
| 18 | candidate: string, |
no outgoing calls
no test coverage detected