Credentials login error

I am trying to add Credentials login. I am putting the code and the error I am getting.
No description
No description
12 Replies
reptiloid
reptiloid2w ago
It looks like something is wrong with the imports. Could you share the whole file?
Climax708
Climax7082w ago
share webpack config?
şiar_619
şiar_619OP2w ago
this is the whole file
şiar_619
şiar_619OP2w ago
sorry i couldn't find the webpack config i am new to t3
şiar_619
şiar_619OP2w ago
https://github.com/siarkonyar/loracassi this is the github repo can you look at it if you are available. I can send the file direct if you can tell me the folder it is in
GitHub
GitHub - siarkonyar/loracassi
Contribute to siarkonyar/loracassi development by creating an account on GitHub.
reptiloid
reptiloid2w ago
I think you are supposed to use the signIn function on the server, and you are using it on the client. In this example from the authjs docs the server action is used. You can use either server action or api endpoint.
Credentials
Authentication for the Web
No description
şiar_619
şiar_619OP2w ago
how can i use it on the server should i create an endpoint for it?
reptiloid
reptiloid2w ago
Yes, you can either create an endpoint or a server action
Data Fetching: Server Actions and Mutations | Next.js
Learn how to handle form submissions and data mutations with Next.js.
şiar_619
şiar_619OP2w ago
i changed the the code like this but i still get the same error
No description
No description
şiar_619
şiar_619OP2w ago
here is the error on the console
No description
No description
şiar_619
şiar_619OP2w ago
hey now even if i remove the lines for sign in i gives the same error

Did you find this page helpful?