diff --git a/back/methods/vn-user/renew-token.js b/back/methods/vn-user/renew-token.js index f3e5c16e4..100e913ee 100644 --- a/back/methods/vn-user/renew-token.js +++ b/back/methods/vn-user/renew-token.js @@ -30,8 +30,11 @@ module.exports = Self => { // Schedule to remove current token setTimeout(async() => { - if (await models.AccessToken.findById(token.id)) + try { await Self.logout(token.id); + } catch (error) { + // FIXME: Crash if do throw new Error(error) + } }, courtesyTime * 1000); // Get scopes