({ token }: { token: string })
| 3 | |
| 4 | export class ApiKeysService { |
| 5 | private static decryptKey({ token }: { token: string }) { |
| 6 | const hash = createHash('sha256') |
| 7 | .update(`${token}${process.env.NEXTAUTH_SECRET}`) |
| 8 | .digest('hex'); |
| 9 | return hash; |
| 10 | } |
| 11 | |
| 12 | private static createKey() { |
| 13 | const token = randomBytes(64).toString('hex'); |
no test coverage detected