username plugin: password.verify not being called?
This is my code.  When doing a POST request to http://localhost:3000/api/auth/sign-in/username 
with: {username:"teste",password:"teste123",rememberMe:true}
It returns: {"code":"INVALID_USERNAME_OR_PASSWORD","message":"Invalid username or password"}
And the hash function is never called. (No print occurs in the logs). 401 is thrown. I am using bcrypt that's why I replaced the verify and hash function.
Solution:Jump to solution
The issue was with providerId in next-auth being credentials and not credential
8 Replies
Under the hood isSamePass and hashPass do:
no we do call the verify function. There are many reasons why you can get the 
INVALID_USERNAME_OR_PASSWORD error. It could be that you don't have a user or an account attached to the req, or if the account isn't credential, amoung other possible reasonsThank you for the information. When the user is not found it throws that in the log so that could not be the case. Any way I can identify the exact reason?
@Picono435 This might be a simple question, but have you created the schema in the SQLite database?
Yes I was migrating from next-auth v4
When there were schema issues it would throw an error in the logs not doing it now
The first thing that comes to my mind is that if this isn't triggered: 
console.error(“NOT PRINTING”) means that it couldn't find the user directly before reaching this stage. Could you examine the database using the SQLite Viewer from the Vs Code extensions or using Prisma studio?It does find the user. Otherwise it would send the
2025-10-27T14:04:21.683Z ERROR [Better Auth]: User not found { username: 'teste' }
 which it doesnt
But double checked with prisma studio and its ther
Solution
The issue was with providerId in next-auth being credentials and not credential