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

Simplified signInPage example #10591

Merged
merged 3 commits into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions docs/pages/guides/pages/signin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,8 @@ We can now build our own custom sign in page:
import { signIn, config, auth } from "../../../auth.ts"
import { redirect } from "next/navigation"

async function getSession() {
const session = await auth()

return {
session,
}
}

export default async function SignInPage() {
const { session } = await getSession()
const session = await auth()

// The user is already logged in, redirect to homepage.
// Make sure is not the same URL to avoid an infinite loop!
Expand Down
Loading