Reverted temporary logging
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		@@ -33,22 +33,18 @@ export class HandleLogout {
 | 
			
		||||
        try {
 | 
			
		||||
            decoded = jsonwebtoken.verify(this.token, config.jwt_secret)
 | 
			
		||||
        } catch (error) {
 | 
			
		||||
            console.log("decoding error")
 | 
			
		||||
            throw new IllegalJWTError()
 | 
			
		||||
        }
 | 
			
		||||
        logout.timestamp = Math.floor(Date.now() / 1000)
 | 
			
		||||
        let found_user: User = await getConnectionManager().get().getRepository(User).findOne({ id: decoded["id"] });
 | 
			
		||||
        if (!found_user) {
 | 
			
		||||
            console.log("user error")
 | 
			
		||||
            throw new UserNotFoundError()
 | 
			
		||||
        }
 | 
			
		||||
        if (found_user.refreshTokenCount !== decoded["refreshTokenCount"]) {
 | 
			
		||||
            console.log("invalid rtc")
 | 
			
		||||
            throw new RefreshTokenCountInvalidError()
 | 
			
		||||
        }
 | 
			
		||||
        found_user.refreshTokenCount++;
 | 
			
		||||
        await getConnectionManager().get().getRepository(User).update({ id: found_user.id }, found_user)
 | 
			
		||||
        console.log("success")
 | 
			
		||||
        return logout;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user