Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions backend/account/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get(self, request):
expires_at=timezone.now() + timedelta(days=7)
)

return redirect(f'{os.getenv("FRONTEND_URL")}/home?access_token={access_token}&refresh_token={refresh_token}&token_expiry={int(token_expiry)}&alertColor=success')
return redirect(f'{os.getenv("FRONTEND_URL")}/home/?access_token={access_token}&refresh_token={refresh_token}&token_expiry={int(token_expiry)}&alertColor=success')

class LogoutView(APIView):
permission_classes = [IsAuthenticated]
Expand Down Expand Up @@ -128,8 +128,8 @@ def post(self, request):
return Response({'message': 'Invalid or expired token. Please log in again.', 'alertColor': 'danger'}, status=400)
except Exception as e:
logger.error(f'Token refresh failed: {str(e)}', exc_info=True)
return Response({'message': 'Token refresh failed', 'error': str(e), 'alertColor': 'danger'}, status=400)
return Response({'message': 'Token refresh failed', 'alertColor': 'danger'}, status=400) # Removed error details

class AdminRedirectView(APIView):
permission_classes =[IsAuthenticated]

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

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

class ProfileView(APIView):
permission_classes = [IsAuthenticated]
Expand Down
11 changes: 11 additions & 0 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
distDir: 'out',
images: {
unoptimized: true
},
trailingSlash: true
}

module.exports = nextConfig
2 changes: 1 addition & 1 deletion frontend/src/app/components/Nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function Nav() {
setAlertMessage(data.message || 'Logout Successful');
setAlertColor(data.alertColor || 'success'); // Set alert color from backend
setTimeout(() => {
window.location.href = '/login';
window.location.reload();
}, 2000); // Redirect after 2 seconds to show the alert
} else {
setAlertMessage(data.message || 'Failed to logout');
Expand Down
Loading