You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, how to make it check that the Auth0 is correct and protect the below view until the Auth0 is verified:
@router.get("/protected", response={200: MessageSchema, 403: ErrorResponse})
def protected_message(request):
if not request.auth:
return ErrorResponse(message="User is not authenticated"), 403
return get_message("This is a protected message.")
The text was updated successfully, but these errors were encountered:
fromninja_jwt.authenticationimportJWTAuth
...
@router.get("/protected", response={200: MessageSchema, 403: ErrorResponse}, auth=JWTAuth())defprotected_message(request):
ifnotrequest.auth:
returnErrorResponse(message="User is not authenticated"), 403returnget_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:
The text was updated successfully, but these errors were encountered: