Files
HexaHost-GameCloud/packages/auth/src/password.ts
smueller 58961000eb
Some checks failed
CI / Node — lint, typecheck, test, build (push) Failing after 9s
CI / Go — node-agent tests (push) Failing after 21s
CI / Go — edge-gateway build (push) Successful in 13s
Phase1
2026-06-26 11:31:54 +02:00

17 lines
328 B
TypeScript

import { hash, verify } from '@node-rs/argon2';
export async function hashPassword(password: string): Promise<string> {
return hash(password);
}
export async function verifyPassword(
plain: string,
hashed: string,
): Promise<boolean> {
try {
return await verify(hashed, plain);
} catch {
return false;
}
}