mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-05 20:41:43 -07:00
Remove redundant disabled auth checks
This commit is contained in:
parent
ddb3f442f8
commit
6725a57237
1 changed files with 0 additions and 14 deletions
|
@ -1,7 +1,5 @@
|
|||
import { useState, useEffect } from "react";
|
||||
import { useHistory } from "react-router-dom";
|
||||
import { useLocalStorage } from "react-use";
|
||||
import axios from "axios";
|
||||
|
||||
import { Divider, Button, Grid, Typography, Box } from "@material-ui/core";
|
||||
import useStyles from "./HomeLoggedIn.styles";
|
||||
|
@ -13,22 +11,10 @@ import { generateNetworkConfig } from "utils/NetworkConfig";
|
|||
|
||||
function HomeLoggedIn() {
|
||||
const [networks, setNetworks] = useState([]);
|
||||
const [, setLoggedIn] = useLocalStorage("loggedIn", false);
|
||||
const [, setDisableAuth] = useLocalStorage("disableAuth", false);
|
||||
const [token, setToken] = useLocalStorage("token", null);
|
||||
|
||||
const classes = useStyles();
|
||||
const history = useHistory();
|
||||
|
||||
axios.get("/auth/login").then(function (response) {
|
||||
if (response.data.enabled) {
|
||||
setDisableAuth(false);
|
||||
if (!token || token.length === 0) {
|
||||
setLoggedIn(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const createNetwork = async () => {
|
||||
const network = await API.post("network", generateNetworkConfig());
|
||||
console.log(network);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue