mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
useAuth
This commit is contained in:
@@ -14,12 +14,11 @@ export default function Login() {
|
||||
|
||||
useEffect(() => {
|
||||
const init = async () => {
|
||||
const response = await axios.get("/api/user/init");
|
||||
if (response.data.message === "No users found") {
|
||||
await axios.get("/api/user/init").then(() => {
|
||||
router.push("/setup");
|
||||
} else {
|
||||
setLoading(false);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
};
|
||||
init();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user