(password: string, salt: string)
| 7 | } |
| 8 | // dup from utilities to avoid circular dependency |
| 9 | function generateHash(password: string, salt: string): string { |
| 10 | const hash = createHmac('sha512', salt); |
| 11 | hash.update(password); |
| 12 | return hash.digest('hex'); |
| 13 | } |
| 14 | |
| 15 | export default function createAuth(options?: Partial<auths>): Promise<auths> { |
| 16 | const password = options?.password || 'password'; |