Skip to content
Snippets Groups Projects
Commit d6f1ce98 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

adding username

parent 1c9748fc
No related branches found
No related tags found
1 merge request!8Esap gui dev
Pipeline #9761 passed
......@@ -4,14 +4,14 @@ import { Nav } from "react-bootstrap";
import { GlobalContext } from "../../contexts/GlobalContext";
export default function AuthControl() {
const { api_host, isAuthenticated } = useContext(GlobalContext);
const { api_host, isAuthenticated, loggedInUserName } = useContext(GlobalContext);
console.log("loggedIn: ", isAuthenticated);
if (isAuthenticated) {
return (
<Nav.Link as={NavLink} to="/logout">
Logout
{`Logout ${loggedInUserName}`}
</Nav.Link>
);
}
......
......@@ -61,7 +61,7 @@ export function GlobalContextProvider({ children }) {
setIsAuthenticated(false);
setSessionid(null);
history.replace("/");
setLoggedInUserName("nobody");
setLoggedInUserName("");
return null;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment