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
I'm quite new to Next.js, so this might just be a question rather than an issue. However, I have some doubts about the implementation of the user registration in actions/auth.ts:
From what I understand, it seems like users are redirected to the dashboard regardless of whether the sign-up was successful. I think this behavior might not be ideal, as it could result in users being redirected even if there was an error during registration.
My proposed solution would be:
Return {success: true} in the try block and {success: false} in the catch block to clearly indicate the outcome of the action.
On the client side (in SignupForm.tsx), use useEffect and useRouter to redirect users to the dashboard only when the action response indicates success.
I realize that this might be addressed later in the course, but I wanted to share my thoughts in case this is an oversight. If this is indeed acknowledged as an issue, what would the next steps be for fixing it?
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
I'm quite new to Next.js, so this might just be a question rather than an issue. However, I have some doubts about the implementation of the user registration in
actions/auth.ts:
From what I understand, it seems like users are redirected to the dashboard regardless of whether the sign-up was successful. I think this behavior might not be ideal, as it could result in users being redirected even if there was an error during registration.
My proposed solution would be:
{success: true}
in the try block and{success: false}
in the catch block to clearly indicate the outcome of the action.SignupForm.tsx
), useuseEffect
anduseRouter
to redirect users to the dashboard only when the action response indicates success.I realize that this might be addressed later in the course, but I wanted to share my thoughts in case this is an oversight. If this is indeed acknowledged as an issue, what would the next steps be for fixing it?
Thanks!
The text was updated successfully, but these errors were encountered: