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

Remove next-auth, replace with x #735

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
16 changes: 1 addition & 15 deletions dashboard/final-example/app/lib/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { z } from 'zod';
import { sql } from '@vercel/postgres';
import { revalidatePath } from 'next/cache';
import { redirect } from 'next/navigation';
import { signIn } from '@/auth';
import { AuthError } from 'next-auth';

const FormSchema = z.object({
id: z.string(),
Expand Down Expand Up @@ -124,17 +122,5 @@ export async function authenticate(
prevState: string | undefined,
formData: FormData,
) {
try {
await signIn('credentials', formData);
} catch (error) {
if (error instanceof AuthError) {
switch (error.type) {
case 'CredentialsSignin':
return 'Invalid credentials.';
default:
return 'Something went wrong.';
}
}
throw error;
}
return null
}
24 changes: 0 additions & 24 deletions dashboard/final-example/auth.config.ts

This file was deleted.

43 changes: 0 additions & 43 deletions dashboard/final-example/auth.ts

This file was deleted.

9 changes: 0 additions & 9 deletions dashboard/final-example/middleware.ts

This file was deleted.

Loading
Loading