aboutsummaryrefslogtreecommitdiff
path: root/src/views/homepage.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/homepage.js')
-rw-r--r--src/views/homepage.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/views/homepage.js b/src/views/homepage.js
index a9cdb50..92f9544 100644
--- a/src/views/homepage.js
+++ b/src/views/homepage.js
@@ -15,9 +15,22 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import { Link } from 'react-router-dom';
+import { Link, useNavigate } from 'react-router-dom';
+import { notificationConfig } from "../classes/notifications";
+import { Store } from "react-notifications-component";
const HomePage = () => {
+ // this is temporary, just for testing
+ // TODO: find better way to do this
+ const navigate = useNavigate();
+ if (!localStorage.getItem("accessToken")) {
+ Store.addNotification({
+ title: "You are not logged in",
+ message: "You need to log in before accessing this page.",
+ ...notificationConfig("default")
+ });
+ navigate("/login")
+ }
return (
<>
<h1>Welcome to OpenBills</h1>