mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-10 23:33:03 -07:00
feat: disable auth (#59)
This commit is contained in:
parent
30069a699f
commit
e7fb4d0aa8
3 changed files with 33 additions and 8 deletions
|
@ -1,6 +1,19 @@
|
|||
import { Grid, Typography } from "@material-ui/core";
|
||||
import { useLocalStorage } from "react-use";
|
||||
import axios from "axios";
|
||||
import { useHistory } from "react-router-dom";
|
||||
|
||||
function HomeLoggedOut() {
|
||||
const [, setLoggedIn] = useLocalStorage("loggedIn", false);
|
||||
const [, setToken] = useLocalStorage("token", null);
|
||||
const history = useHistory();
|
||||
axios.get("/auth/login").then(function (response) {
|
||||
if (!response.data.enabled) {
|
||||
setLoggedIn(true);
|
||||
setToken("");
|
||||
history.go(0);
|
||||
}
|
||||
});
|
||||
return (
|
||||
<Grid
|
||||
container
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue