Skip to content

Commit

Permalink
Merge pull request #55 from IntelliSOFT-Consulting:client-path
Browse files Browse the repository at this point in the history
Revise auth client paths
  • Loading branch information
nyatindopatrick authored Nov 11, 2024
2 parents d0a7b85 + 66bdb76 commit 896a1f2
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/api/useApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const useApiRequest = () => {
} catch (error) {
if (error?.response?.status === 401) {
localStorage.clear()
navigate('/auth')
navigate('/user-auth')
}
}
}
Expand Down Expand Up @@ -73,7 +73,7 @@ export const useApiRequest = () => {
} catch (error) {
if (error?.response?.status === 401) {
localStorage.clear()
navigate('/auth')
navigate('/user-auth')
}
}
}
Expand All @@ -87,7 +87,7 @@ export const useApiRequest = () => {
} catch (error) {
if (error?.response?.status === 401) {
localStorage.clear()
navigate('/auth')
navigate('/user-auth')
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/ProfileDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function ProfileDropdown() {

function logUserOut() {
localStorage.clear()
navigate("/auth")
navigate("/user-auth")
}

return (
Expand Down Expand Up @@ -78,7 +78,7 @@ export default function ProfileDropdown() {
<Menu.Item>
{({ active }) => (
<Link
to="/auth"
to="/user-auth"
onClick={logUserOut}
className={classNames(active ? 'bg-gray-100' : '', 'block px-4 py-2 text-sm text-gray-700')}>
Logout
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function Home() {

if (userStorage === 'undefined' || userStorage === null || !Object.keys(userStorage).length) {
localStorage.clear()
navigate("/auth")
navigate("/user-auth")
}

setUser(JSON.parse(userStorage))
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default function Login() {

<p className='text-center mt-3 mb-5'>
Don't have an account?{" "}
<Link className='text-[#163C94]' to='/auth/registration'>
<Link className='text-[#163C94]' to='/user-auth/registration'>
Sign up here
</Link>
</p>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Registration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function Registration() {
setRegistrationError(false);
message.success("Registration successful, log in with the credentials used");

navigate("/auth");
navigate("/user-auth");
}
} catch (e) {
console.log({ e });
Expand Down Expand Up @@ -157,7 +157,7 @@ function Registration() {

<p className='text-center mt-3 mb-5'>
Already have an account?{" "}
<Link className='text-[#163C94]' to='/auth'>
<Link className='text-[#163C94]' to='/user-auth'>
Login here
</Link>
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ResetPassword.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function ResetPassword() {
if (!results) {
// Error message is shown
} else {
navigation("/auth/set-password");
navigation("/user-auth/set-password");
}
} catch (e) {
console.log({ e });
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SetNewPassword.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function SetNewPassword() {
} else {
message.info('Password reset successfully, you can login')

navigation("/auth/login")
navigation("/user-auth/login")
}
} catch (e) {
console.log({ e })
Expand Down
2 changes: 1 addition & 1 deletion src/routes/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const router = createBrowserRouter([
]
},
{
path: '/auth',
path: '/user-auth',
element: <UnauthorizedLayout />,
errorElement: <Page404 />,
children: [
Expand Down

0 comments on commit 896a1f2

Please sign in to comment.