(params: VerifyCallbackTokenParams)
| 65 | } |
| 66 | |
| 67 | export async function verifyCallbackToken(params: VerifyCallbackTokenParams): Promise<boolean> { |
| 68 | if (!params.token || !CALLBACK_TOKEN_HEX_PATTERN.test(params.token)) { |
| 69 | return false; |
| 70 | } |
| 71 | if (!hasCallbackTokenSecret(params.secret)) { |
| 72 | return false; |
| 73 | } |
| 74 | |
| 75 | const expectedToken = await deriveCallbackToken(params); |
| 76 | return equalLengthStringsMatch(expectedToken, params.token); |
| 77 | } |
no test coverage detected