codex-team/hawk.javascript

Check for correct integration token passed

neSpecc opened this issue · 0 comments

If an incorrect Token is passed, an error will be thrown

image

There should be try/catch statement

private getIntegrationId(): string {
const decodedIntegrationToken: DecodedIntegrationToken = JSON.parse(atob(this.token));
const integrationId = decodedIntegrationToken.integrationId;
if (!integrationId || integrationId === '') {
throw new Error('Invalid integration token. There is no integration ID.');
}
return integrationId;
}