diff --git a/backend/src/routes/users.js b/backend/src/routes/users.js index 6b62646..109a300 100644 --- a/backend/src/routes/users.js +++ b/backend/src/routes/users.js @@ -82,7 +82,7 @@ router.patch('/me', authenticate, updateProfileValidation, updateProfile); router.patch('/me/password', authenticate, changePasswordValidation, changePassword); // GET /api/users/:username - Get public user profile by username -router.get('/:username', authenticate, async (req, res, next) => { +router.get('/:username', async (req, res, next) => { try { const { username } = req.params; @@ -149,7 +149,7 @@ router.get('/:username', authenticate, async (req, res, next) => { }); // GET /api/users/:username/ratings - Get ratings for a user -router.get('/:username/ratings', authenticate, async (req, res, next) => { +router.get('/:username/ratings', async (req, res, next) => { try { const { username } = req.params; diff --git a/frontend/src/pages/NotFoundPage.jsx b/frontend/src/pages/NotFoundPage.jsx index d6564e9..d62ade3 100644 --- a/frontend/src/pages/NotFoundPage.jsx +++ b/frontend/src/pages/NotFoundPage.jsx @@ -45,14 +45,16 @@ export default function NotFoundPage() {

- {/* Current Path */} -
-

Requested URL:

- - {location.pathname} - {location.search} - -
+ {/* Current Path - Only show in dev mode */} + {import.meta.env.DEV && ( +
+

Requested URL:

+ + {location.pathname} + {location.search} + +
+ )} {/* Action Buttons */}
diff --git a/frontend/src/pages/PublicProfilePage.jsx b/frontend/src/pages/PublicProfilePage.jsx index 0862b1a..dcca94d 100644 --- a/frontend/src/pages/PublicProfilePage.jsx +++ b/frontend/src/pages/PublicProfilePage.jsx @@ -2,8 +2,9 @@ import { useState, useEffect } from 'react'; import { useParams, Link } from 'react-router-dom'; import { authAPI, ratingsAPI } from '../services/api'; import Layout from '../components/layout/Layout'; -import { User, MapPin, Globe, Hash, Youtube, Instagram, Facebook, Award, Users, Star, Calendar, Loader2, AlertCircle, ThumbsUp } from 'lucide-react'; +import { User, MapPin, Globe, Hash, Youtube, Instagram, Facebook, Award, Users, Star, Calendar, Loader2, ThumbsUp } from 'lucide-react'; import Avatar from '../components/common/Avatar'; +import NotFoundPage from './NotFoundPage'; const PublicProfilePage = () => { const { username: rawUsername } = useParams(); @@ -61,25 +62,7 @@ const PublicProfilePage = () => { } if (error) { - return ( - -
-
-
- -

User Not Found

-

{error}

- - Back to Events - -
-
-
-
- ); + return ; } return (