Skip to content

Commit

Permalink
Delete the refresh token at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-gai committed Apr 4, 2022
1 parent 90973c0 commit d1df659
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions web-app/src/eventHandlers/pullRequestEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,15 @@ Please fix the issues and recreate a new PR:
} catch (err) {
const errorMessage = HelperService.getErrorMessage(err);
logger.error(errorMessage);
} finally {
// Delete the token to avoid conflicts with prod
const appId = this._configService.appConfig.appId;
if (appId !== ConfigService.prodAppId) {
logger.info(`Current app (${appId}) is not prod, deleting ${authorLogin}'s refresh token`);
this._tokenService.deleteRefreshToken(authorLogin);
}
}
}
}
// Delete the token to avoid conflicts with prod
const appId = this._configService.appConfig.appId;
if (appId !== ConfigService.prodAppId) {
logger.info(`Current app (${appId}) is not prod, deleting ${authorLogin}'s refresh token`);
await this._tokenService.deleteRefreshToken(authorLogin);
}
logger.info("Exiting pull_request.closed handler");
};

Expand Down

0 comments on commit d1df659

Please sign in to comment.