diff --git a/Client/src/Components/Button/index.jsx b/Client/src/Components/Button/index.jsx index bba101dc1..485973498 100644 --- a/Client/src/Components/Button/index.jsx +++ b/Client/src/Components/Button/index.jsx @@ -58,6 +58,7 @@ const Button = ({ disabled, img, onClick, + props, sx, }) => { const { variant, color } = levelConfig[level]; @@ -84,6 +85,7 @@ const Button = ({ }, ...sx, }} + {...props} > {img && img} {label} diff --git a/Client/src/Components/NavBar/index.jsx b/Client/src/Components/NavBar/index.jsx index 08eb91580..95123d975 100644 --- a/Client/src/Components/NavBar/index.jsx +++ b/Client/src/Components/NavBar/index.jsx @@ -21,6 +21,8 @@ import UserSvg from "../../assets/icons/user.svg?react"; import TeamSvg from "../../assets/icons/user-two.svg?react"; import LogoutSvg from "../../assets/icons/logout.svg?react"; import { Stack, useScrollTrigger } from "@mui/material"; +import axiosIntance from "../../Utils/axiosConfig"; +import axios from "axios"; const icons = { Profile: , @@ -93,10 +95,21 @@ function NavBar() { * Handles logging out the user * */ - const logout = () => { + const logout = async () => { // Clear auth state dispatch(clearAuthState()); dispatch(clearUptimeMonitorState()); + // Make request to BE to remove JWT from user + await axiosIntance.post( + "/auth/logout", + { email: authState.user.email }, + { + headers: { + Authorization: `Bearer ${authState.authToken}`, + "Content-Type": "application/json", + }, + } + ); navigate("/login"); }; diff --git a/Client/src/Pages/Auth/Login.jsx b/Client/src/Pages/Auth/Login.jsx index 2868b5d75..eef972ec4 100644 --- a/Client/src/Pages/Auth/Login.jsx +++ b/Client/src/Pages/Auth/Login.jsx @@ -94,7 +94,7 @@ const StepOne = ({ form, errors, onSubmit, onChange, onBack }) => { id="login-email-input" label="Email" isRequired={true} - placeholder="john.doe@domain.com" + placeholder="jordan.ellis@domain.com" autoComplete="email" value={form.email} onChange={onChange} @@ -117,6 +117,7 @@ const StepOne = ({ form, errors, onSubmit, onChange, onBack }) => { mr: theme.gap.xs, }, }} + props={{ tabIndex: -1 }} />