1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-12-26 13:38:52 +00:00

Disconnect user from all services

This commit is contained in:
Pierre HUBERT 2020-03-27 15:13:16 +01:00
parent b69b93a9d9
commit 3ab8a56ef7

View File

@ -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