Next.js Discord

Discord Forum

bcrypt auth module error

Answered
Asian black bear posted this in #help-forum
Open in Discord
Asian black bearOP
Guys, I'm encountering an error when attempting to authenticate using credentials. I've followed the step-by-step guide on Next's "learn" portal, and I'm receiving this error when trying to access the login.

I suspect it's due to bcrypt, given that the form is client-side, but I'm struggling to resolve it... The call should be made via the server, but it's not working... Any ideas on how to help?
Answered by Asian black bear
Just noticed the solution. My action was not with "use server"; That was the issue
View full answer

3 Replies

Asian black bearOP
Middleware.ts
import NextAuth from 'next-auth';
import { authConfig } from './auth.config';
 
export default NextAuth(authConfig).auth;
 
export const config = {
  // https://nextjs.org/docs/app/building-your-application/routing/middleware#matcher
  matcher: ['/((?!api|_next/static|_next/image|.png).*)'],
};
Asian black bearOP
Just noticed the solution. My action was not with "use server"; That was the issue
Answer