(env: Env, submitted: string)
| 89 | } |
| 90 | |
| 91 | export async function checkPassword(env: Env, submitted: string): Promise<boolean> { |
| 92 | // A misconfigured deployment must not become an open dashboard. |
| 93 | if (!env.ADMIN_PASSWORD || !env.SESSION_SECRET) return false; |
| 94 | return equalsInConstantTime(submitted, env.ADMIN_PASSWORD); |
| 95 | } |
| 96 | |
| 97 | export async function issueSession(env: Env): Promise<string> { |
| 98 | const now = Math.floor(Date.now() / 1000); |
no test coverage detected