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

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

Open
fomalhautb opened this issue Oct 7, 2024 · 5 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@fomalhautb
Copy link
Contributor

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 fomalhautb added the good first issue Good for newcomers label Oct 7, 2024
@Jarvis-3000
Copy link
Contributor

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

@fomalhautb
Copy link
Contributor Author

Sure!

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

@Jarvis-3000
Copy link
Contributor

Jarvis-3000 commented Oct 9, 2024

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.

Sign-in-recording.mp4

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
Copy link
Contributor

Hey @fomalhautb

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

@Jarvis-3000 Jarvis-3000 removed their assignment Oct 24, 2024
@Mubashirshariq
Copy link
Contributor

@fomalhautb can i work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants