mirror of
				https://github.com/evgen-app/chess_rpg_backend.git
				synced 2025-11-04 01:37:30 +03:00 
			
		
		
		
	fixed no auth header error
This commit is contained in:
		
							parent
							
								
									80a63fe252
								
							
						
					
					
						commit
						acc37f8e82
					
				| 
						 | 
				
			
			@ -6,8 +6,8 @@ from .services.jwt import read_jwt
 | 
			
		|||
 | 
			
		||||
class PlayerAuthentication(authentication.BaseAuthentication):
 | 
			
		||||
    def authenticate(self, request):
 | 
			
		||||
        token = request.headers["Authorization"]
 | 
			
		||||
        if not token:
 | 
			
		||||
 | 
			
		||||
        if "Authorization" not in request.headers or not (token := request.headers["Authorization"]):
 | 
			
		||||
            raise exceptions.AuthenticationFailed("No credentials provided.")
 | 
			
		||||
 | 
			
		||||
        t = read_jwt(token)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user