stack icon indicating copy to clipboard operation
stack copied to clipboard

/handler/forgot-password page shouldn't be shown when password auth is disabled

Open fomalhautb opened this issue 1 year ago • 4 comments

The page should show a message card saying that password authentication is disabled on the client side. The stack handler should redirect it back to home on the server side.

This is similar to how the other pages work

fomalhautb avatar Oct 07 '24 15:10 fomalhautb

Hey @fomalhautb I would like to work on this issue.

Jarvis-3000 avatar Oct 08 '24 09:10 Jarvis-3000

Sure!

Hey @fomalhautb I would like to work on this issue.

fomalhautb avatar Oct 08 '24 17:10 fomalhautb

Hey @fomalhautb

In the context of "redirect it back to home" Currently, on /handler/sign-in page if a user is already signed-in then it is showing a MessageCard and immediately redirecting to home page making it look like a glitch/blink.

https://github.com/user-attachments/assets/ee116e2d-6a92-447c-9886-658cfd5e6f52

packages/stack/src/components-page/auth-page.tsx

  useEffect(() => {
    if (props.automaticRedirect) {
      if (user && !props.mockProject) {
        runAsynchronously(props.type === 'sign-in' ? stackApp.redirectToAfterSignIn() : stackApp.redirectToAfterSignUp());
      }
    }
  }, [user, props.mockProject, stackApp, props.automaticRedirect]);

  if (user && !props.mockProject) {
    return <PredefinedMessageCard type='signedIn' fullPage={props.fullPage} />;
  }

I think we have 2 approaches

1. Delayed Redirect with User Acknowledgment Show the message, and after a short delay (e.g., 3-5 seconds), automatically redirect the user. This approach gives users time to read the message but then smoothly redirects them.

2. Toast Notification with Instant Redirect Immediately redirect the user while displaying a non-blocking toast or banner notification that informs the user they were already signed in. The user can see the message even after redirection. This keeps the user experience smooth and allows them to be redirected without a delay.

Same for the /handler/forgot-password if password auth is disabled

Kindly give your thoughts on this

Jarvis-3000 avatar Oct 09 '24 11:10 Jarvis-3000

Hey @fomalhautb

I know you must be busy but an opinion would be really helpful to finish this task.

Jarvis-3000 avatar Oct 11 '24 08:10 Jarvis-3000

@fomalhautb can i work on this

Mubashirshariq avatar Oct 27 '24 16:10 Mubashirshariq

@Mubashirshariq are you still working on this issue

Priyansh1547 avatar Dec 08 '24 14:12 Priyansh1547

Is this issue resolved? if not I would like to work on it.

VivekGupta99 avatar Dec 31 '24 07:12 VivekGupta99