Temporary: extended live 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:
		| @@ -25,6 +25,7 @@ export class HandleLogout { | ||||
|      */ | ||||
|     public async logout(): Promise<Logout> { | ||||
|         let logout: Logout = new Logout(); | ||||
|         console.log(this.token) | ||||
|         if (!this.token || this.token === undefined) { | ||||
|             throw new JwtNotProvidedError() | ||||
|         } | ||||
| @@ -32,14 +33,17 @@ 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++; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user