* fix: login redirection * dev: log the user out when deactivating the account * dev: update redirect uris for google and github * fix: redirection url and invitation api and add redirection to god mode in nginx * dev: add reset password redirection * dev: update nginx headers * dev: fix setup sh and env example and put validation for use minio when fetching project covers * dev: stabilize dev setup * fix: handled redirection error in web, space, and admin apps * fix: resovled build errors --------- Co-authored-by: pablohashescobar <nikhilschacko@gmail.com>
12 lines
439 B
Python
12 lines
439 B
Python
from rest_framework.views import exception_handler
|
|
from rest_framework.exceptions import NotAuthenticated
|
|
|
|
|
|
def auth_exception_handler(exc, context):
|
|
# Call the default exception handler first, to get the standard error response.
|
|
response = exception_handler(exc, context)
|
|
# Check if an AuthenticationFailed exception is raised.
|
|
if isinstance(exc, NotAuthenticated):
|
|
response.status_code = 401
|
|
|
|
return response
|