Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login page #205

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Login page #205

wants to merge 13 commits into from

Conversation

VikramChilkunda
Copy link
Collaborator

Added a custom login page with Google OAuth

return NextResponse.next();
}
const token = await getToken({ req, secret: process.env.NEXTAUTH_SECRET });
if (!token) {
const signInPage = '/api/auth/signin';
const signInPage = '/login';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try moving this to globals.js

<center>
<h1 className="text-2xl font-bold mt-0 rounded-sm py-1 px-1 text-blue-800">
<div key="google">
<button onClick={ () => signIn('google', { callbackUrl: "/" }) } className='border-blue-800 border-solid border-2 p-5 rounded-lg'>
Copy link
Collaborator

@joseph082 joseph082 May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This forces users to go to the main page after logging in.
Maybe getting rid of callbackUrl will fix it: https://next-auth.js.org/getting-started/client#specifying-a-callbackurl Or try to read the query parameter from http://localhost:3000/login?callbackUrl=%2F and pass that into here. Or there might be another way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants