()
| 47 | } |
| 48 | |
| 49 | export function generateApiKey(): { key: string; hash: string } { |
| 50 | const secret = crypto.randomBytes(32).toString('hex'); |
| 51 | const hash = hashSecret(secret); |
| 52 | |
| 53 | return { |
| 54 | key: `${API_KEY_PREFIX}${secret}`, |
| 55 | hash, |
| 56 | }; |
| 57 | } |
| 58 | |
| 59 | export function generateOAuthToken(): { token: string; hash: string } { |
| 60 | const secret = crypto.randomBytes(32).toString('hex'); |
no test coverage detected