feat: implement Redis session management and user authentication flow

This commit is contained in:
2025-12-30 01:38:09 +00:00
parent 1688ca0d23
commit 29523ef22f
20 changed files with 820 additions and 5 deletions
@@ -0,0 +1,13 @@
import { createHash, randomBytes } from 'node:crypto';
export interface PasswordHasher {
createSalt(): string;
hash(password: string, salt: string): string;
}
// 비밀번호 해싱은 임시 구현이므로 이후 안전한 KDF로 교체한다.
export const createSimplePasswordHasher = (): PasswordHasher => ({
createSalt: () => randomBytes(16).toString('hex'),
hash: (password: string, salt: string) =>
createHash('sha256').update(`${salt}:${password}`).digest('hex'),
});