diff --git a/src/helpers/AccountHelper.ts b/src/helpers/AccountHelper.ts index a527ced..a45f898 100644 --- a/src/helpers/AccountHelper.ts +++ b/src/helpers/AccountHelper.ts @@ -281,6 +281,20 @@ export class AccountHelper { }); } + /** + * Delete all user login tokens + * + * This method has for immediate effect to disconnect + * the user from all its devices + * + * @param userID Target user ID + */ + public static async DeleteAllUserLoginTokens(userID: number) { + await DatabaseHelper.DeleteRows(USERS_TOKENS_TABLE, { + user_id: userID + }) + } + /** * Get the ID of a user from a password reset token * @@ -483,6 +497,9 @@ export class AccountHelper { // Delete user background image await BackgroundImageHelper.Delete(userID); + + // Delete connections to all services + await this.DeleteAllUserLoginTokens(userID); */ // TODO : continue work