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

fix: Minor login improvements #322

Merged
merged 1 commit into from
Aug 21, 2023
Merged

Conversation

dennis-campos
Copy link
Contributor

@dennis-campos dennis-campos commented Jul 14, 2023

Changes

  • Fix an issue where the form justified to the left when resizing to a small viewport.
  • Fix an issue where the router was not routing them to /login page after signing out.
  • Fix an issue if you enter your email and password, and you press "enter," it redirects you to /reset-password when it should log you in.

Checklist

  • Requires dependency update?
  • Generating a new app works

@dennis-campos dennis-campos changed the title form to stay centered, redirect to login page. Upon pressing enter ro… fix: Minor login improvements Jul 14, 2023
Comment on lines -94 to -95
<NextLink href="/reset-password">
<Button variant="link" size="sm">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think NextLink is necessary anymore. I'm also not seeing it in the "pages" docs

<NextLink href="/reset-password">
<Button variant="link" size="sm">
<Link href="/reset-password">
<Button variant="link" size="sm" type="button">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user hits enter on their keyboard, it redirected them to /reset-password instead of signing in. The workaround is having type=button attribute. This is necessary when there are multiple buttons in a form.

async function handleLogout() {
signOut();
await router.replace('/login');
Copy link
Contributor Author

@dennis-campos dennis-campos Jul 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This caused a flash to /login page and redirected the user back to /

@dennis-campos dennis-campos merged commit af9b80b into canary Aug 21, 2023
6 checks passed
@dennis-campos dennis-campos deleted the fix/minor-login-improvements branch August 21, 2023 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants