Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(signup): show password rules on the invite signup form (#130604)

Fernando Gomes4d24f0cee0eb
diff --git a/frontend/src/scenes/authentication/invite-signup/InviteSignup.test.tsx b/frontend/src/scenes/authentication/invite-signup/InviteSignup.test.tsx
index 049cd08af9e2..57b6b45e7439 100644
--- a/frontend/src/scenes/authentication/invite-signup/InviteSignup.test.tsx
+++ b/frontend/src/scenes/authentication/invite-signup/InviteSignup.test.tsx
@@ -49,6 +49,15 @@ describe('InviteSignup', () => {
expect(screen.getByText('Please enter your password to continue')).toBeInTheDocument()
})
+ it('states the password rules before the first submit, then shows live feedback for a short password', async () => {
+ const passwordInput = await screen.findByPlaceholderText('••••••••••')
+ expect(screen.getByText(/At least 8 characters/)).toBeInTheDocument()
+
+ await userEvent.type(passwordInput, 'abc')
+
+ expect(await screen.findByText('Must be at least 8 characters long')).toBeInTheDocument()
+ })
+
it('marks the role as optional, because this form submits without one', async () => {
expect((await screen.findByText('What is your role?')).closest('label')).toHaveTextContent('(optional)')
})
diff --git a/frontend/src/scenes/authentication/invite-signup/InviteSignupForm.tsx b/frontend/src/scenes/authentication/invite-signup/InviteSignupForm.tsx
index aa5de282be04..566bdc52a88b 100644
--- a/frontend/src/scenes/authentication/invite-signup/InviteSignupForm.tsx
+++ b/frontend/src/scenes/authentication/invite-signup/InviteSignupForm.tsx
@@ -36,6 +36,8 @@ import { ErrorCodes, inviteSignupLogic } from './inviteSignupLogic'
const HedgehogJudge = pngHoggie(judgePng)
+const PASSWORD_RULES = 'At least 8 characters. Avoid common words and patterns.'
+
/**
* Invite-signup alternatives row: social/SSO icons plus an optional passkey signup icon.
* The passkey button is assembled here (not in SocialLoginButtons) because a passkey isn't a social login.
@@ -196,6 +198,7 @@ function InviteNewUser({ invite }: { invite: PrevalidatedInvite }): JSX.Element
<PasswordStrength validatedPassword={validatedPassword} />
</div>
}
+ help={validatedPassword.feedback || PASSWORD_RULES}
>
{({ value, onChange, error, id }) => (
<LemonInput