homebridge-prometheus-exporter/src/security.ts

10 lines
228 B
TypeScript
Raw Normal View History

import { compare } from 'bcrypt'
export function isAuthenticated(
username: string,
plainPassword: string,
map: Record<string, string>,
): Promise<boolean> {
return compare(plainPassword, map[username] || '')
}