-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
GOOGLE_CLIENT_ID=... | ||
GOOGLE_CLIENT_SECRET=... | ||
NEXTAUTH_URL=https://vighnesh153.com | ||
NEXTAUTH_SECRET="Charizard is the best and coolest pokemon ever ❤️" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { useSession, signIn } from 'next-auth/react'; | ||
import { CircularProgress, Box } from '@mui/material'; | ||
import { not } from '@vighnesh153/utils'; | ||
import { ProfileBox } from './profile-box'; | ||
import { SignInButton } from './sign-in-button'; | ||
|
||
export function AuthBox() { | ||
const { data: session, status } = useSession(); | ||
const isLoading = status === 'loading'; | ||
const user = session?.user; | ||
|
||
if (isLoading) { | ||
return ( | ||
<Box sx={{ width: 40, display: 'grid', placeItems: 'center' }}> | ||
<CircularProgress color="info" size={20} /> | ||
</Box> | ||
); | ||
} | ||
|
||
if (not(session) || not(session?.user)) { | ||
return <SignInButton onClick={() => signIn('google')} />; | ||
} | ||
|
||
return <ProfileBox user={user} />; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
export * from './404-page'; | ||
export * from './aside-email-address'; | ||
export * from './aside-social-links'; | ||
export * from './auth-box'; | ||
export * from './border-corner-animation-link'; | ||
export * from './focus-dashed-outline'; | ||
export * from './head'; | ||
export * from './navbar'; | ||
export * from './next-link'; | ||
export * from './sign-in-button'; | ||
export * from './skip-to-main-content'; | ||
export * from './underlined-animation-link'; |
03afd56
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
vighnesh153-main – ./
vighnesh153-main-vighnesh153.vercel.app
vighnesh153-main.vercel.app
vighnesh153-main-git-main-vighnesh153.vercel.app