Skip to content

Commit

Permalink
fix: code cleanup due to the closing of feathersjs/feathers#2835
Browse files Browse the repository at this point in the history
  • Loading branch information
claustres committed Jul 11, 2023
1 parent 7afe696 commit 4a771eb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions core/client/utils/utils.session.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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
}
Expand Down

0 comments on commit 4a771eb

Please # to comment.