From 90973c0ff538e30124d0b1207f7c1bb6bc42e419 Mon Sep 17 00:00:00 2001 From: Philip Gai Date: Mon, 4 Apr 2022 18:54:06 +0000 Subject: [PATCH] Handle if token is missing --- web-app/src/services/tokenService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web-app/src/services/tokenService.ts b/web-app/src/services/tokenService.ts index 8c9462e..7cd1019 100644 --- a/web-app/src/services/tokenService.ts +++ b/web-app/src/services/tokenService.ts @@ -96,11 +96,11 @@ export class TokenService { public async deleteRefreshToken(userLogin: string): Promise { this._logger.info(`Deleting user token for "${userLogin}"`); - const item = this._container.item(userLogin, userLogin); - if (item) { + try { + const item = this._container.item(userLogin, userLogin); await item.delete(); this._logger.info("Deleted user token."); - } else { + } catch { this._logger.info("No token found for the user."); } }