-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
1 deletion.
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
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 |
---|---|---|
|
@@ -71,4 +71,7 @@ export const authOptions: NextAuthOptions = { | |
}; | ||
}, | ||
}, | ||
pages: { | ||
signIn: '/auth/signin', | ||
}, | ||
}; |
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,55 @@ | ||
import { getProviders, signIn } from 'next-auth/react'; | ||
import { ClientSafeProvider } from 'next-auth/react/types'; | ||
import { ReactNode } from 'react'; | ||
|
||
import LandingPageLayout from '../../components/LandingPageLayout'; | ||
|
||
interface SigninProps { | ||
providers: ClientSafeProvider[]; | ||
} | ||
|
||
const Signin = (props: SigninProps) => { | ||
const { providers } = props; | ||
|
||
return ( | ||
<div className="w-screen min-h-screen flex flex-col justify-center items-center"> | ||
<div className="flex flex-col justify-center items-center"> | ||
<div className="h-80 w-80 bg-white shadow-lg px-12 py-12 rounded-2xl"> | ||
<div className="w-full text-center pb-3"> | ||
<span className="text-xl font-bold text-primary text-center"> | ||
Sign In | ||
</span> | ||
</div> | ||
{providers && | ||
Object.values(providers).map((provider) => ( | ||
<div className="mt-4" key={provider.id}> | ||
<button | ||
onClick={() => | ||
signIn(provider.id, { | ||
callbackUrl: '/app/dashboard', | ||
}) | ||
} | ||
className="w-full inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2" | ||
> | ||
Sign in with {provider.name} | ||
</button> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
Signin.getLayout = (page: ReactNode) => { | ||
return <LandingPageLayout>{page}</LandingPageLayout>; | ||
}; | ||
|
||
export async function getServerSideProps() { | ||
const providers = await getProviders(); | ||
return { | ||
props: { providers }, | ||
}; | ||
} | ||
|
||
export default Signin; |
bbfaa7a
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:
planner – ./
planner-nine.vercel.app
planner-dv297.vercel.app
planner-git-main-dv297.vercel.app