Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.

Commit ea8f7be

Browse files
authored
Merge pull request #1 from 0xtejas/main
Fix issue - Information exposure through an exception
2 parents 8c4dd7d + 62d6393 commit ea8f7be

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

backend/account/views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ def post(self, request):
128128
return Response({'message': 'Invalid or expired token. Please log in again.', 'alertColor': 'danger'}, status=400)
129129
except Exception as e:
130130
logger.error(f'Token refresh failed: {str(e)}', exc_info=True)
131-
return Response({'message': 'Token refresh failed', 'error': str(e), 'alertColor': 'danger'}, status=400)
132-
131+
return Response({'message': 'Token refresh failed', 'alertColor': 'danger'}, status=400) # Removed error details
132+
133133
class AdminRedirectView(APIView):
134134
permission_classes =[IsAuthenticated]
135135

@@ -164,7 +164,7 @@ def get(self, request):
164164
return Response({'message': 'Token is invalid or expired', 'alertColor': 'danger'}, status=401)
165165
except Exception as e:
166166
logger.error('Authentication Failed', exc_info=True)
167-
return Response({'message': 'Authentication Failed', 'error': str(e), 'alertColor': 'danger'}, status=401)
167+
return Response({'message': 'Authentication Failed', 'alertColor': 'danger'}, status=401) # Removed error details
168168

169169
class VerifyTokenView(APIView):
170170
permission_classes = [AllowAny]
@@ -180,7 +180,7 @@ def post(self, request):
180180
return Response({'message': 'Invalid or expired token'}, status=401)
181181
except Exception as e:
182182
logger.error('Token verification failed', exc_info=True)
183-
return Response({'message': 'Token verification failed', 'error': str(e)}, status=400)
183+
return Response({'message': 'Token verification failed', 'alertColor': 'danger'}, status=400) # Removed error details
184184

185185
class ProfileView(APIView):
186186
permission_classes = [IsAuthenticated]

0 commit comments

Comments
 (0)