Fix redis checking for token invalidation
This commit is contained in:
		
							parent
							
								
									d0fd8a34f5
								
							
						
					
					
						commit
						63ef1179fc
					
				@ -14,4 +14,6 @@ def create_app():
 | 
			
		||||
	from app.config import FlaskTesting, FlaskProduction
 | 
			
		||||
	app.config.from_object(FlaskTesting)
 | 
			
		||||
 | 
			
		||||
	from . import jwt_utils
 | 
			
		||||
 | 
			
		||||
	return app
 | 
			
		||||
@ -2,11 +2,11 @@ from app.extensions import jwt_redis_blocklist
 | 
			
		||||
 | 
			
		||||
from . import jwt_manager
 | 
			
		||||
 | 
			
		||||
@jwt.token_in_blocklist_loader
 | 
			
		||||
from app import app
 | 
			
		||||
 | 
			
		||||
@jwt_manager.token_in_blocklist_loader
 | 
			
		||||
def check_if_token_is_revoked(jwt_header, jwt_payload: dict) -> bool:
 | 
			
		||||
	jti = jwt_payload["jti"]
 | 
			
		||||
	token_in_redis = jwt_redis_blocklist.get(jti)
 | 
			
		||||
 | 
			
		||||
	print(token_in_redis)
 | 
			
		||||
	
 | 
			
		||||
	return token_in_redis is not None
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user