mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-18 16:07:10 +00:00
Setup Page init
This commit is contained in:
parent
6c0edecabf
commit
ac6c71eee9
@ -3,11 +3,11 @@
|
||||
import Image from "next/image"
|
||||
import Link from "next/link"
|
||||
|
||||
import {useEffect} from "react";
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import axios from "axios";
|
||||
|
||||
export default function LoginPage() {
|
||||
export default function Login() {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
26
app/setup/page.tsx
Normal file
26
app/setup/page.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import axios from "axios";
|
||||
|
||||
|
||||
export default function SetupPage() {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
const init = async () => {
|
||||
const response = await axios.get("/api/user/init");
|
||||
if (response.data.message !== "No users found") {
|
||||
router.push("/");
|
||||
}
|
||||
};
|
||||
init();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>Setup</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user