Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

routes update #67

Merged
merged 1 commit into from
Oct 5, 2024
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 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
Loading