diff --git a/README.md b/README.md index 222d0c7..6212a74 100644 --- a/README.md +++ b/README.md @@ -183,3 +183,26 @@ | Add Elections API (Admin Only) | Delete Elections API (Admin Only) | Get Elections API | | ------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------ | | ![Landing](./readme/postman%20apis/add%20elections.png) | ![fsdaf](./readme/postman%20apis/delete%20elections.png) | ![fsdaf](./readme/postman%20apis/get%20elections'.png) | + +

+ +### To login to the system: + +A default admin user is available with the credentials: + + email: test@example.com + + password: 123456 + +Admins have full control over the system. They can: + +- Create and manage elections +- Add candidate users +- Start and stop elections at any time + + Despite their administrative privileges, admins can also participate in voting like regular users. + +Candidates can: + +- Create and update their campaign profiles +- Participate in elections as voters diff --git a/client/src/Utils/helpers.js b/client/src/Utils/helpers.js index 4d82cf1..6ecdc6d 100644 --- a/client/src/Utils/helpers.js +++ b/client/src/Utils/helpers.js @@ -12,7 +12,7 @@ export const capitalizeTitle = (str) => { .join(' '); }; -const BASE_URL = "http://127.0.0.1:8000"; +const BASE_URL = "http://13.38.84.88:8000"; export default function getProfilePictureUrl(path) { if (!path) return null; return `${BASE_URL}/storage/${path}`; diff --git a/client/src/components/PrivateRoute/index.jsx b/client/src/components/PrivateRoute/index.jsx index 09fdd5a..004317e 100644 --- a/client/src/components/PrivateRoute/index.jsx +++ b/client/src/components/PrivateRoute/index.jsx @@ -1,11 +1,12 @@ import React, { useContext } from "react"; import { Navigate } from "react-router-dom"; import { AuthContext } from "../Context/AuthorizationContext"; +import Loading from "../Loading"; const PrivateRoute = ({ children }) => { const { user, authLoading } = useContext(AuthContext); - if (authLoading) return
Loading...
; + if (authLoading) return ; return user ? children : ; };