client frontend tested
This commit is contained in:
@@ -20,7 +20,7 @@ from endpoints.index import endpoints_index
|
||||
|
||||
from api_validations.defaults.validations import CommonHeaders
|
||||
from api_middlewares.token_provider import TokenProvider
|
||||
|
||||
from events.auth.events import LoginHandler
|
||||
|
||||
auth_route = APIRouter(prefix="/authentication", tags=["Authentication Cluster"])
|
||||
|
||||
@@ -124,8 +124,12 @@ auth_route_check_token = "AuthCheckToken"
|
||||
)
|
||||
def check_token(headers: CommonHeaders = Depends(CommonHeaders.as_dependency)):
|
||||
"""Check if token is valid"""
|
||||
token_object = TokenProvider.get_dict_from_redis(token=headers.token)
|
||||
return None
|
||||
try:
|
||||
if token_object := LoginHandler.authentication_check_token_valid(access_token=headers.token, domain=headers.domain):
|
||||
return JSONResponse(status_code=status.HTTP_200_OK, content={"success": True})
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return JSONResponse(status_code=status.HTTP_401_UNAUTHORIZED, content={"success": False})
|
||||
|
||||
|
||||
auth_route_refresh_token = "AuthRefreshToken"
|
||||
|
||||
Reference in New Issue
Block a user