f8007b55ca
Allows restricting access to the monitoring endpoint using basic auth and configure TLS certificates.
9 lines
228 B
TypeScript
9 lines
228 B
TypeScript
import { compare } from 'bcrypt'
|
|
|
|
export function isAuthenticated(
|
|
username: string,
|
|
plainPassword: string,
|
|
map: Record<string, string>,
|
|
): Promise<boolean> {
|
|
return compare(plainPassword, map[username] || '')
|
|
}
|