mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 03:24:04 +00:00 
			
		
		
		
	Disconnect user from all services
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user