mirror of
https://github.com/towfiqi/serpbear
synced 2025-06-26 18:15:54 +00:00
chore: Removes Unecessay code
This commit is contained in:
@@ -2,13 +2,10 @@ import type { NextPage } from 'next';
|
||||
import { useEffect, useState } from 'react';
|
||||
import Head from 'next/head';
|
||||
import { useRouter } from 'next/router';
|
||||
// import { useEffect, useState } from 'react';
|
||||
import { Toaster } from 'react-hot-toast';
|
||||
import Icon from '../components/common/Icon';
|
||||
import AddDomain from '../components/domains/AddDomain';
|
||||
|
||||
// import verifyUser from '../utils/verifyUser';
|
||||
|
||||
const Home: NextPage = () => {
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [domains, setDomains] = useState<Domain[]>([]);
|
||||
@@ -54,32 +51,4 @@ const Home: NextPage = () => {
|
||||
);
|
||||
};
|
||||
|
||||
// export const getServerSideProps = async (context:NextPageContext) => {
|
||||
// const { req, res } = context;
|
||||
// const authorized = verifyUser(req as NextApiRequest, res as NextApiResponse);
|
||||
// // console.log('####### authorized: ', authorized);
|
||||
|
||||
// if (authorized !== 'authorized') {
|
||||
// return { redirect: { destination: '/login', permanent: false } };
|
||||
// }
|
||||
|
||||
// let domains: Domain[] = [];
|
||||
// try {
|
||||
// const fetchOpts = { method: 'GET', headers: { Authorization: `Bearer ${process.env.APIKEY}` } };
|
||||
// const domainsRes = await fetch(`${process.env.NEXT_PUBLIC_APP_URL}/api/domains`, fetchOpts).then((result) => result.json());
|
||||
// // console.log(domainsRes);
|
||||
|
||||
// domains = domainsRes.domains;
|
||||
// if (domains.length > 0) {
|
||||
// const firstDomainItem = domains[0].slug;
|
||||
// return { redirect: { destination: `/domain/${firstDomainItem}`, permanent: false } };
|
||||
// }
|
||||
// } catch (error) {
|
||||
// console.log(error);
|
||||
// }
|
||||
|
||||
// // console.log('domains: ', domains);
|
||||
// return { props: { authorized, domains } };
|
||||
// };
|
||||
|
||||
export default Home;
|
||||
|
||||
Reference in New Issue
Block a user