Skip to content

Conversation

@lionello
Copy link
Member

@lionello lionello commented Sep 22, 2025

Samples Checklist

✅ All good!

@lionello lionello requested a review from Copilot September 22, 2025 20:16
@lionello lionello had a problem deploying to deploy-changed-samples September 22, 2025 20:16 — with GitHub Actions Failure
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new pseudoidc-starter sample application featuring authentication using both email magic links and ConsentKeys OIDC provider integration. The sample provides a complete Next.js authentication starter kit with BetterAuth, demonstrating how to implement dual authentication methods in a production-ready application.

  • Email magic link authentication flow with nodemailer integration
  • ConsentKeys OIDC provider authentication with detailed debugging
  • Complete Next.js application structure with protected routes and authentication UI

Reviewed Changes

Copilot reviewed 29 out of 37 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tsconfig.json Standard Next.js TypeScript configuration with path aliases
src/lib/db/schema.ts Database schema for user, session, account, and verification tables
src/lib/db/index.ts Database connection setup using Drizzle ORM with PostgreSQL
src/lib/auth/authClient.ts Frontend auth client configuration with magic link and OAuth plugins
src/lib/auth/auth.ts Main BetterAuth server configuration with nodemailer and OIDC setup
src/lib/auth.ts Minimal auth configuration file
src/components/layout/sign-out-button.tsx Reusable sign-out button component
src/components/forms/login-form.tsx Complete login form with magic link and OAuth options
src/app/protected/page.tsx Protected route example with session validation
src/app/page.tsx Home page with authentication-based routing
src/app/login/page.tsx Login page layout and session redirect
src/app/layout.tsx Root layout with font setup
src/app/globals.css Global styles with Tailwind CSS
src/app/api/auth/email/route.ts API route for handling magic link requests
src/app/api/auth/[...auth]/route.ts BetterAuth API route handler
package.json Project dependencies and scripts for development
drizzle files Database migration files and configuration
Documentation README and setup guides for the sample

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

});
if (session) {
redirect('/protected');
}else{
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

Add a space after 'else' for consistent formatting: } else {

Suggested change
}else{
} else {

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +15
import { redirect } from 'next/navigation'
import { useState } from 'react';

const SignOutButton = () => {

const [isLoading, setIsLoading] = useState(false);

const handleSignOut = async () => {
setIsLoading(true);
await signOut();
setIsLoading(false);
redirect('/login');
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

The redirect function cannot be used in client components. It should be used in Server Components or Server Actions. Consider using router.push() from next/navigation instead, or handle the redirect after successful sign-out.

Suggested change
import { redirect } from 'next/navigation'
import { useState } from 'react';
const SignOutButton = () => {
const [isLoading, setIsLoading] = useState(false);
const handleSignOut = async () => {
setIsLoading(true);
await signOut();
setIsLoading(false);
redirect('/login');
import { useRouter } from 'next/navigation'
import { useState } from 'react';
const SignOutButton = () => {
const [isLoading, setIsLoading] = useState(false);
const router = useRouter();
const handleSignOut = async () => {
setIsLoading(true);
await signOut();
setIsLoading(false);
router.push('/login');

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +7
import { betterAuth } from "better-auth"

export const auth = betterAuth({
// Basic configuration
})

export const { handler, api } = auth No newline at end of file
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

This file appears to be unused as the main auth configuration is in src/lib/auth/auth.ts. Consider removing this file to avoid confusion or clearly document its purpose if it's intended for a different use case.

Suggested change
import { betterAuth } from "better-auth"
export const auth = betterAuth({
// Basic configuration
})
export const { handler, api } = auth

Copilot uses AI. Check for mistakes.
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