feat: add auth to server requests

This commit is contained in:
Carlos Valente
2025-01-14 13:59:10 +01:00
committed by Carlos Valente
parent ce8d534953
commit 7fe5223af9
9 changed files with 294 additions and 19 deletions
+9
View File
@@ -0,0 +1,9 @@
import { createHash } from 'node:crypto';
/**
* Creates a hash of the password that is URL safe
* @link https://stackoverflow.com/questions/17639645/websafe-encoding-of-hashed-string-in-nodejs
*/
export function hashPassword(password: string) {
return createHash('sha256').update(password).digest('base64url');
}