Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
9 replies
utdev

Nextauth Credentials provider

I setup up the Github provider and added the Credentials provider to login with an email and password. The Github provider works fine, but now I tried to add the Credentials provider with jwt, but I can't make it work.

Currently I get this error if I try to sign in:

[next-auth][error][JWT_SESSION_ERROR]
https://next-auth.js.org/errors#jwt_session_error Cannot read property 'id' of undefined {


Currently I am signin it doing this in my form:
  const onSubmit = useCallback(async (data: Login) => {
    await signIn('credentials', { ...data, callbackUrl: '/dashboard' })
  }, [])
Was this page helpful?