(count = 10)
| 71 | } |
| 72 | |
| 73 | export function generateRecoveryCodes(count = 10): string[] { |
| 74 | return Array.from({ length: count }, randomRecoveryCode); |
| 75 | } |
| 76 | |
| 77 | export async function hashRecoveryCodes(codes: string[]): Promise<string[]> { |
| 78 | return Promise.all(codes.map((code) => hashPassword(normalizeRecoveryCode(code)))); |