You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue with CredentialsProvider in NextAuth.js when Changing Credential Fields
Description
I am experiencing an issue with CredentialsProvider in NextAuth.js. The error occurs when I modify the default credentials object to include additional fields.
Here is the situation:
When using the default credentials object, everything works fine.
When I change the credentials object to include additional fields, I encounter an error.
I have strict type checking enabled (strict: true) in my tsconfig.json file.
The error message does not provide a clear solution.
It seems like there might be a type mismatch or an issue with how the new fields are being validated.
How to reproduce
Steps to Reproduce
Prerequisites
Ensure you have Node.js and npm installed
Have Git configured on your system
Steps
Clone the Repository and Set Up the Project
Clone the repository and install the required dependencies by following the version specifications mentioned in the project documentation.
Observe the Error
Open the config.ts file and review the error message that appears. This might be related to incorrect configurations or other issues in the file.
Expected behavior
Expected Behavior
I expect to be able to modify the credentials object to include custom fields without encountering any errors.
Actual Behavior
An error occurs when I add custom fields to the credentials object.
Environment
NextAuth.js Version: [Specify version]
TypeScript Version: [Specify version]
Node.js Version: [Specify version]
Operating System: [Specify OS]
Question
Is there a specific TypeScript type I need to define to allow custom fields in the credentials object?
Are there any additional configurations required in NextAuth.js to support custom credential fields?
Any help or suggestions would be greatly appreciated!
The text was updated successfully, but these errors were encountered:
Provider type
Credentials
Environment
Reproduction URL
https://github.com/Prashant-S29/ici-fest-skit.git
Describe the issue
Issue with
CredentialsProvider
in NextAuth.js when Changing Credential FieldsDescription
I am experiencing an issue with
CredentialsProvider
in NextAuth.js. The error occurs when I modify the defaultcredentials
object to include additional fields.Here is the situation:
credentials
object, everything works fine.credentials
object to include additional fields, I encounter an error.I have
strict: true
set in mytsconfig.json
file.Working Code
This configuration works without any issues:
Non-Working Code
When I change the
credentials
object as shown below, I get an error:TS Error message
When I change the
credentials
object as shown above, I get this TS error:Additional Context
strict: true
) in mytsconfig.json
file.How to reproduce
Steps to Reproduce
Prerequisites
Steps
Clone the Repository and Set Up the Project
Clone the repository and install the required dependencies by following the version specifications mentioned in the project documentation.
Navigate to the Configuration File
Locate the
config.ts
file in the following project structure:Observe the Error
Open the
config.ts
file and review the error message that appears. This might be related to incorrect configurations or other issues in the file.Expected behavior
Expected Behavior
I expect to be able to modify the
credentials
object to include custom fields without encountering any errors.Actual Behavior
An error occurs when I add custom fields to the
credentials
object.Environment
Question
credentials
object?Any help or suggestions would be greatly appreciated!
The text was updated successfully, but these errors were encountered: