mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-15 04:13:47 +00:00
feat: add auth to server requests
This commit is contained in:
committed by
Carlos Valente
parent
ce8d534953
commit
7fe5223af9
@@ -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');
|
||||
}
|
||||
Reference in New Issue
Block a user