From 4a771eb917e43ef3a262ff393920abf0633b56b8 Mon Sep 17 00:00:00 2001 From: Luc Claustres Date: Tue, 11 Jul 2023 21:30:51 +0200 Subject: [PATCH] fix: code cleanup due to the closing of https://github.com/feathersjs/feathers/issues/2835 --- core/client/utils/utils.session.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/core/client/utils/utils.session.js b/core/client/utils/utils.session.js index 7ed884fcc..a0a0c5779 100644 --- a/core/client/utils/utils.session.js +++ b/core/client/utils/utils.session.js @@ -23,12 +23,7 @@ export async function register (user) { } export async function logout () { - try { - await api.logout() - } catch (error) { - logger.warn(`[KDK] logout session failed: ${error}`) - await api.authentication.removeAccessToken() - } + await api.logout() Store.set('user', null) } @@ -39,7 +34,7 @@ export async function restoreSession () { Store.set('user', user) } catch (error) { // This ensure an old token is not kept when the user has been deleted - if (error.code === 404) await logout() + await logout() // Rethrow for caller to handle throw error }