Skip to content

Commit

Permalink
Merge pull request #67 from Premkolte/main
Browse files Browse the repository at this point in the history
routes update
  • Loading branch information
dhairyagothi authored Oct 5, 2024
2 parents 347af2b + 11bb697 commit 2a970cd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ function App() {
<Router>
<Routes>
<Route path="/" element={<Herosection />} />
<Route path="/login" element={<LoginPage />} />
<Route path="/register" element={<Register />} />
<Route path="/Login" element={<LoginPage />} />
<Route path="/Register" element={<Register />} />

{/* This route is just for testing protected routes it can be removed later when there is a route other than login or signup */}
<Route element={<ProtectedRoute />}>
Expand Down Expand Up @@ -55,15 +55,15 @@ export function ProtectedRoute() {
console.log('Token Verification error:', data.error); // For debugging

if (data.error || res.status === 400 || res.status === 500) {
navigate('/login');
navigate('/Login');
}

if (res.status === 400 || res.status === 500) {
navigate('/login');
navigate('/Login');
}
} catch (error) {
console.error('Error verifying token:', error);
navigate('/login');
navigate('/Login');
}
};

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/Herosection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Herosection = () => {
const navigate = useNavigate();

const LoginClick = () => {
navigate('/login'); // Navigates to the login page
navigate('/Login'); // Navigates to the login page
};
const RegisterClick = () => {
navigate('/Register'); // Navigates to the login page
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/LoginPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const Login = () => {
{/* Don't have an account link */}
<p className="mt-6 text-gray-600">
Don't have an account?{' '}
<a href="/register" className="text-blue-500 font-semibold hover:underline transition duration-300 transform hover:scale-105">
<a href="/Register" className="text-blue-500 font-semibold hover:underline transition duration-300 transform hover:scale-105">
Register
</a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/Register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const Register = () => {
{/* Already have an account link */}
<p className="mt-4 text-gray-700 text-sm">
Already have an account?{' '}
<a href="/login" className="text-blue-500 font-medium hover:underline transition duration-300 transform hover:scale-105">
<a href="/Login" className="text-blue-500 font-medium hover:underline transition duration-300 transform hover:scale-105">
Log in
</a>
</p>
Expand Down

0 comments on commit 2a970cd

Please sign in to comment.