Skip to content

Commit

Permalink
remove NextAuth
Browse files Browse the repository at this point in the history
I am not using this library at all so just cleaning it up as it is causing some package versioning issues.
  • Loading branch information
wtLau committed Apr 12, 2024
1 parent 5bc1b87 commit 4eaceab
Show file tree
Hide file tree
Showing 8 changed files with 14,360 additions and 10,351 deletions.
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
31 changes: 8 additions & 23 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'styles/global.css'

import { MDXProvider } from '@mdx-js/react'
import { CssBaseline } from '@mui/material'
import { Provider as NextAuthProvider } from 'next-auth/client'
import type { AppProps } from 'next/app'
import { useRouter } from 'next/dist/client/router'
import React, { useEffect } from 'react'
Expand Down Expand Up @@ -33,30 +32,16 @@ function MyApp({ Component, pageProps }: AppProps) {
return (
<>
<Head />
<NextAuthProvider session={pageProps.session}>
<ThemeCustomProvider theme={theme}>
<CssBaseline />
<AppLayout>
<MDXProvider components={MDXComponents}>
<Component {...pageProps} />
</MDXProvider>
</AppLayout>
</ThemeCustomProvider>
</NextAuthProvider>
<ThemeCustomProvider theme={theme}>
<CssBaseline />
<AppLayout>
<MDXProvider components={MDXComponents}>
<Component {...pageProps} />
</MDXProvider>
</AppLayout>
</ThemeCustomProvider>
</>
)
}

// Only uncomment this method if you have blocking data requirements for
// every single page in your application. This disables the ability to
// perform automatic static optimization, causing every page in your app to
// be server-side rendered.
//
// MyApp.getInitialProps = async (appContext) => {
// // calls page's `getInitialProps` and fills `appProps.pageProps`
// const appProps = await App.getInitialProps(appContext);
//
// return { ...appProps }
// }

export default MyApp
8 changes: 3 additions & 5 deletions pages/about.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Typography, Button, Grid } from '@mui/material'
import { useSession } from 'next-auth/client'
import Image from 'next/image'
import React, { useState, useEffect } from 'react'

Expand All @@ -10,9 +9,8 @@ import { companyData } from '@data/companyData'
import { skillsData, TSkills } from '@data/skillsData'

const About = () => {
const [session] = useSession()
const [skills, setSkills] = useState<TSkills[]>([])
const userName = session?.user?.name || 'stranger'
const userName = 'stranger'

useEffect(() => {
setSkills(skillsData)
Expand Down Expand Up @@ -41,8 +39,8 @@ const About = () => {
/>
<Grid item xs={12}>
<Typography paragraph>
{session && `Hi, ${userName}.`} My name is Brian, and I am
currently living in North Vancouver, Canada.
Hi, ${userName}. My name is Brian, and I am currently living in
North Vancouver, Canada.
</Typography>

<Typography paragraph>
Expand Down
99 changes: 0 additions & 99 deletions pages/api/auth/[...nextauth].ts

This file was deleted.

19 changes: 0 additions & 19 deletions pages/api/user.ts

This file was deleted.

4 changes: 1 addition & 3 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Typography } from '@mui/material'
import Grid from '@mui/material/Grid'
import { styled } from '@mui/material/styles'
import { useSession } from 'next-auth/client'
import { FC } from 'react'

import { Link } from '@components/ui'
Expand All @@ -10,8 +9,7 @@ const StyledGrid = styled(Grid)({
})

const Index: FC = () => {
const [session] = useSession()
const userName = session?.user?.name || 'stranger'
const userName = 'stranger'
return (
<StyledGrid container justifyContent='center' alignItems='center'>
<Grid container spacing={8} alignContent='center'>
Expand Down
42 changes: 0 additions & 42 deletions pages/profile.tsx

This file was deleted.

Loading

0 comments on commit 4eaceab

Please sign in to comment.