()
| 57 | } |
| 58 | |
| 59 | export function generateOAuthToken(): { token: string; hash: string } { |
| 60 | const secret = crypto.randomBytes(32).toString('hex'); |
| 61 | const hash = hashSecret(secret); |
| 62 | |
| 63 | return { |
| 64 | token: `${OAUTH_ACCESS_TOKEN_PREFIX}${secret}`, |
| 65 | hash, |
| 66 | }; |
| 67 | } |
| 68 | |
| 69 | export function generateOAuthRefreshToken(): { token: string; hash: string } { |
| 70 | const secret = crypto.randomBytes(32).toString('hex'); |
no test coverage detected