Skip to content

Commit

Permalink
[CARD-23] Rm faulty auth mechanism (causing vercel err)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrsmth-tier2 committed Jan 23, 2024
1 parent 07d75a5 commit 74d93da
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
17 changes: 0 additions & 17 deletions app/fit-track/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
"use server"
import React, { Suspense } from 'react'
import { redirect } from 'next/navigation';
import { GetInitialProps } from '@/core/interfaces/page.interface';
import { authUtil } from '@/core/utils/auth.util';
import Wallet from '@/core/components/wallet/Wallet';
import Menu from '@/core/components/menu/Menu';
import styles from './FitTrack.module.scss'
Expand All @@ -25,10 +22,6 @@ interface Week {
};
}

interface GetInitialReturnProps {
authToken: string | undefined;
}

async function FitTrackContent() {
const weeks: Week[] = await getWeeks();

Expand Down Expand Up @@ -74,14 +67,4 @@ const FitTrackPage = async () => {
);
}

FitTrackPage.getInitialProps = async (ctx: GetInitialProps): Promise<GetInitialReturnProps> => {
const authToken = authUtil.getAuthToken(ctx);

if (!authToken) {
redirect('/login');
}

return {authToken};
};

export default FitTrackPage;
17 changes: 1 addition & 16 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";

import { authUtil } from "@/core/utils/auth.util";
import { GetInitialProps } from "@/core/interfaces/page.interface";
import { redirect } from "next/navigation";
import Home from "./home/page";

Expand All @@ -10,20 +9,6 @@ import Home from "./home/page";
// description: "/ˈkɑːdɪnəl/ Of the greatest importance; fundamental."
// }

interface GetInitialReturnProps {
authToken: string | undefined;
}

export default function App(ctx: { pageProps: GetInitialReturnProps }) {
export default function App() {
redirect('/home');
}

App.getInitialProps = async (ctx: GetInitialProps): Promise<GetInitialReturnProps> => {
const authToken = authUtil.getAuthToken(ctx);

if (!authToken) {
redirect('/login');
}

return { authToken };
};

0 comments on commit 74d93da

Please sign in to comment.