Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when null returned as user not found in db it go error insted of redirecting to error page or back to login #12206

Open
MartinAbilev opened this issue Nov 9, 2024 · 0 comments
Labels
bug Something isn't working providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@MartinAbilev
Copy link

Provider type

Credentials

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
    Memory: 4.41 GB / 15.92 GB
  Binaries:
    Node: 21.7.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.10.0 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    next: latest => 14.2.17
    next-auth: 5.0.0-beta.18 => 5.0.0-beta.18
    react: 18.3.0 => 18.3.0

Reproduction URL

https://github.com/MartinAbilev/biauth

Describe the issue

when entering wrong creditentials and null is returned instead of user we got

Unhandled Runtime Error
Error: Read more at https://errors.authjs.dev#credentialssignin

Call Stack
Module.callback
file:///E:/dv/biauth/.next/server/chunks/ssr/node_modules_@auth_core_d0bdea._.js (2958:30)

How to reproduce

just try to returning null in creditentials

Credentials({
  async authorize({ email, password }: any) {
     return null;

  },
}),

Expected behavior

i expect behavior where redirect hapens to errpage i specify in

pages: {
signIn: '/login',
error: '/error'
},

or back to login.

@MartinAbilev MartinAbilev added bug Something isn't working providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

1 participant