( deploymentId: string, type: string, encryptedPassword?: string | null )
| 21 | } |
| 22 | |
| 23 | function generateAuthToken( |
| 24 | deploymentId: string, |
| 25 | type: string, |
| 26 | encryptedPassword?: string | null |
| 27 | ): string { |
| 28 | const payload = `${deploymentId}:${type}:${Date.now()}:${passwordSlot(encryptedPassword)}` |
| 29 | const sig = signPayload(payload) |
| 30 | return Buffer.from(`${payload}:${sig}`).toString('base64') |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Validates an HMAC-signed authentication token for a chat deployment. |
no test coverage detected