Credentials SignIn #7
-
Hello, I have added the SignIn credentials, but I don't want to be redirected if the credentials are incorrect. I need a boolean or something similar to determine if the SignIn failed, so that I can display an appropriate message. By using the signIn(credentials, { redirect: false, username: 'admin', password: 'admin' }) syntax, I am able to disable the redirect. However, I'm not aware of any method to directly retrieve the login status in case of failure. Is there any alternative method to achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
Hi, What would you like to happen ? |
Beta Was this translation helpful? Give feedback.
-
Hi,
However, it only outputs "SignIn" and does not enter the catch block. The "async authorize(..." function in the CredentialsProvider returns null when the username and password are not "admin,". I am confident that I have made a mistake in my implementation. If you could kindly assist me, I would greatly appreciate it.
|
Beta Was this translation helpful? Give feedback.
-
https://stackblitz.com/edit/nuxt-starter-3bmqov?file=README.md. This is an illustrative example. P.S. The website's behavior aligns with the description provided. However, when attempting to log in with the correct credentials on StackBlitz, an error occurs. I attempted to use the @auth library in Next.js, but encountered the same issue, which seems to be specific to StackBlitz. |
Beta Was this translation helpful? Give feedback.
-
Additionally, in the event that I attempt to access a webpage that necessitates authentication, I will be automatically redirected to the default page, which is set as "/". Is it possible to designate a custom page for redirection? If so, how can I do? EDIT: I saw in the code that is not configurable yet |
Beta Was this translation helpful? Give feedback.
-
Use v0.1.0 https://github.com/Hebilicious/authjs-nuxt/releases/tag/v0.1.0 |
Beta Was this translation helpful? Give feedback.
Use v0.1.0 https://github.com/Hebilicious/authjs-nuxt/releases/tag/v0.1.0