Open magedhelmy1 opened 1 year ago
@magedhelmy1 I dont quite get your question. Can you explain more please?
from ninja_jwt.authentication import JWTAuth
...
@router.get("/protected", response={200: MessageSchema, 403: ErrorResponse}, auth=JWTAuth())
def protected_message(request):
if not request.auth:
return ErrorResponse(message="User is not authenticated"), 403
return get_message("This is a protected message.")
Below is a working example from Django Rest Framework:
Now, how to make it check that the Auth0 is correct and protect the below view until the Auth0 is verified: