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
Copy file name to clipboardExpand all lines: docs/pages/getting-started/providers/credentials.mdx
+40-26Lines changed: 40 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,24 +7,9 @@ The Credentials provider allows you to handle signing in with arbitrary credenti
7
7
8
8
It is intended to support use cases where you have an existing system you need to authenticate users against, and therefore users authenticated in this manner are not persisted in the database.
9
9
10
-
<Callouttype="warning">
11
-
OAuth providers spend significant amounts of money, time, and engineering effort to build:
- data security (encryption/salting, strength validation)
10
+
## Resources
16
11
17
-
and much more for authentication solutions. It is likely that your application would benefit from leveraging these battle-tested solutions rather than try to rebuild them from scratch.
18
-
19
-
If you'd still like to build password-based authentication for your application despite these risks, Auth.js gives you full control to do so.
20
-
21
-
</Callout>
22
-
23
-
<Callouttype="warning">
24
-
There is no validation on the user inputs by default. We recommend validating
25
-
user input at runtime using a library like [Zod](https://zod.dev) or
See the [callbacks documentation](/reference/core#authconfig#callbacks) for more information on how to interact with the token. For example, you can add additional information to the token by returning an object from the `jwt()` callback:
91
+
### Custom Error Messages
92
+
93
+
You can throw a custom error in the `authorize` function to return a custom error message to the user.
You will then receive that custom error code in the query parameters of the signin page your user returns to after a failed login attempt, for example `https://app.company.com/auth/signin?error=CredentialsSignin&code=Invalid+identifier+or+password`.
119
+
120
+
<Callouttype="warning">
121
+
OAuthprovidersspendsignificantamountsofmoney, time, andengineeringefforttobuild:
0 commit comments