Credential
Traditional email + password authentication.
Setup
import { AuthKit } from "@astra-void/auth-kit";
import { CredentialProvider } from "@astra-void/auth-kit/providers";
import { PrismaAdapter } from "@astra-void/auth-kit/adapters";
export const handler = AuthKit({
adapter: PrismaAdapter(prisma),
providers: [
CredentialProvider(),
]
});-
You may use argon2, bcrypt, or other hashers.
-
Simple and widely compatible.
-
No extra config required.
Override
You can override the internal authorize logic if needed:
CredentialProvider({
authorize: async (body) => {
console.log("Custom authorize called");
return null;
},
});-
authorizereceives the request body (email, password, etc.) -
Must return an AdapterUser or
null
Notes
The default authorize expects { email, password } in the request body
See Also
Last updated on