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(clerk-js): Show error during instant password error #4910

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

alexcarpenter
Copy link
Member

@alexcarpenter alexcarpenter commented Jan 16, 2025

Description

When an password is incorrectly autofilled during sign-in, render an incorrect password error vs moving to first factor.

Screen.Recording.2025-01-16.at.9.27.17.AM.mov

Fixes SDK-2029

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Copy link

vercel bot commented Jan 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 16, 2025 2:51pm

Copy link

changeset-bot bot commented Jan 16, 2025

🦋 Changeset detected

Latest commit: b69e14f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

'@clerk/clerk-js': patch
---

Show password error for incorrect passwords during instant password verification.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Show password error for incorrect passwords during instant password verification.
Show error for incorrect passwords during instant password verification.

@@ -123,6 +123,15 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('sign in f
await u.po.expect.toBeSignedOut();
});

test('cannot sign in with email and wrong instant password', async ({ page, context }) => {
Copy link
Member

Choose a reason for hiding this comment

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

👏

@@ -355,7 +355,7 @@ export function _SignInStart(): JSX.Element {
);

if (instantPasswordError) {
await signInWithFields(identifierField);
Copy link
Member

Choose a reason for hiding this comment

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

Interesting, so this was actually intentional 🤔 I'm wondering if we want to continue to move to the factor-one view but show an error, or if we want to keep them on the start view. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

What was the intention here ? Why do we think navigating them to another screen is better (even with your proposed fix) ?

Copy link
Member

Choose a reason for hiding this comment

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

Likely to automatically give them another sign in option if one is available, without requiring additional action. If they have another auth option available they would now have to manually empty the password field and click continue. The start screen isn't setup to give them additional options (e.g. no "forgot password" link). It's possible someone gets stuck in this error case.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds like a state that you can find yourself if your password manager is not up to date and still tries to use a password that you had before. Yeah I get it now. Let's add a comment in that line that explains the intent, i this this will be useful for the future.

@alexcarpenter alexcarpenter marked this pull request as draft January 16, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants