-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #400 from mit-27/remove-stytch-add-auth
Remove stytch auth and implement custom Auth
- Loading branch information
Showing
74 changed files
with
1,272 additions
and
2,489 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
output: 'standalone' | ||
output: 'standalone', | ||
async redirects() { | ||
return [ | ||
{ | ||
source: '/', | ||
destination: '/connections', | ||
permanent: true | ||
} | ||
] | ||
} | ||
}; | ||
|
||
export default nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
apps/client-ts/src/app/connections/page.tsx → .../src/app/(Dashboard)/connections/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
apps/client-ts/src/app/events/page.tsx → ...nt-ts/src/app/(Dashboard)/events/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
'use client' | ||
import { Inter } from "next/font/google"; | ||
import "./../globals.css"; | ||
import { RootLayout } from "@/components/RootLayout"; | ||
import { useRouter } from "next/navigation"; | ||
import { useEffect, useState } from "react"; | ||
import Cookies from 'js-cookie'; | ||
import useFetchUserMutation from "@/hooks/mutations/useFetchUserMutation"; | ||
|
||
|
||
|
||
const inter = Inter({ subsets: ["latin"] }); | ||
|
||
export default function Layout({ | ||
children, | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
}>) { | ||
|
||
const [userInitialized,setUserInitialized] = useState(false) | ||
const router = useRouter() | ||
const {mutate: fetchUserMutate} = useFetchUserMutation() | ||
|
||
|
||
|
||
useEffect(() => { | ||
if(!Cookies.get('access_token')) | ||
{ | ||
router.replace("/b2c/login") | ||
} | ||
else | ||
{ | ||
|
||
fetchUserMutate(Cookies.get('access_token'),{ | ||
onError: () => router.replace("/b2c/login"), | ||
onSuccess: () => setUserInitialized(true) | ||
}) | ||
} | ||
},[]) | ||
|
||
|
||
|
||
|
||
return ( | ||
<> {userInitialized ? ( | ||
<> | ||
<RootLayout> | ||
{children} | ||
</RootLayout> | ||
</> | ||
) : ( | ||
<> | ||
|
||
</> | ||
)} | ||
|
||
</> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.