mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-25 23:09:22 +00:00
Disconnect user from all services
This commit is contained in:
parent
b69b93a9d9
commit
3ab8a56ef7
@ -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
|
* Get the ID of a user from a password reset token
|
||||||
*
|
*
|
||||||
@ -483,6 +497,9 @@ export class AccountHelper {
|
|||||||
|
|
||||||
// Delete user background image
|
// Delete user background image
|
||||||
await BackgroundImageHelper.Delete(userID);
|
await BackgroundImageHelper.Delete(userID);
|
||||||
|
|
||||||
|
// Delete connections to all services
|
||||||
|
await this.DeleteAllUserLoginTokens(userID);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// TODO : continue work
|
// TODO : continue work
|
||||||
|
Loading…
Reference in New Issue
Block a user