Skip to content

Commit 5cac123

Browse files
committed
feat(signup): show identity + 'Not you?' back-to-signup on the password step
1 parent 43b5dfe commit 5cac123

3 files changed

Lines changed: 35 additions & 12 deletions

File tree

app/modules/i18n/locales/en.po

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ msgstr "Change your password"
144144

145145
#: app/routes/password/reset.tsx:98
146146
#: app/routes/signup/method.tsx:255
147-
#: app/routes/signup/password.tsx:170
147+
#: app/routes/signup/password.tsx:177
148148
msgid "Check your email"
149149
msgstr "Check your email"
150150

@@ -177,7 +177,7 @@ msgid "Confirm new password"
177177
msgstr "Confirm new password"
178178

179179
#: app/routes/password/change.tsx:113
180-
#: app/routes/signup/password.tsx:213
180+
#: app/routes/signup/password.tsx:227
181181
msgid "Confirm password"
182182
msgstr "Confirm password"
183183

@@ -212,7 +212,7 @@ msgid "Create a new account"
212212
msgstr "Create a new account"
213213

214214
#: app/routes/login/index.tsx:417
215-
#: app/routes/signup/password.tsx:217
215+
#: app/routes/signup/password.tsx:231
216216
msgid "Create account"
217217
msgstr "Create account"
218218

@@ -381,6 +381,7 @@ msgid "Not registered?"
381381
msgstr "Not registered?"
382382

383383
#: app/components/identity-badge/identity-badge.tsx:28
384+
#: app/routes/signup/password.tsx:197
384385
msgid "Not you?"
385386
msgstr "Not you?"
386387

@@ -403,7 +404,7 @@ msgid "Passkey"
403404
msgstr "Passkey"
404405

405406
#: app/routes/login/method.tsx:132
406-
#: app/routes/signup/password.tsx:209
407+
#: app/routes/signup/password.tsx:223
407408
#: app/routes/sso/ldap.tsx:77
408409
msgid "Password"
409410
msgstr "Password"
@@ -501,7 +502,7 @@ msgid "Session active"
501502
msgstr "Session active"
502503

503504
#: app/routes/signup/method.tsx:334
504-
#: app/routes/signup/password.tsx:185
505+
#: app/routes/signup/password.tsx:192
505506
msgid "Set a password"
506507
msgstr "Set a password"
507508

@@ -573,6 +574,10 @@ msgstr "Sign-in is currently unavailable for this account. Please contact your a
573574
msgid "Signing in as"
574575
msgstr "Signing in as"
575576

577+
#: app/routes/signup/password.tsx:195
578+
msgid "Signing up as"
579+
msgstr "Signing up as"
580+
576581
#: app/routes/setup/mfa.tsx:209
577582
msgid "Skip for now"
578583
msgstr "Skip for now"
@@ -767,7 +772,7 @@ msgstr "We've sent a password reset link to <0>{0}</0>"
767772
#. placeholder {0}: (actionData as { email: string }).email
768773
#. placeholder {0}: actionData.email
769774
#: app/routes/signup/method.tsx:257
770-
#: app/routes/signup/password.tsx:172
775+
#: app/routes/signup/password.tsx:179
771776
msgid "We've sent a verification link to <0>{0}</0>"
772777
msgstr "We've sent a verification link to <0>{0}</0>"
773778

@@ -816,10 +821,6 @@ msgstr "You signed in as a different account than the one you were re-authentica
816821
msgid "You'll be asked to sign in before authorizing."
817822
msgstr "You'll be asked to sign in before authorizing."
818823

819-
#: app/routes/signup/password.tsx:186
820-
msgid "You'll need to set a password to complete your signup."
821-
msgstr "You'll need to set a password to complete your signup."
822-
823824
#: app/routes/signup/method.tsx:279
824825
msgid "You're almost done! <0>{loginName}</0>"
825826
msgstr "You're almost done! <0>{loginName}</0>"

app/routes/signup/password.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { MaxMindTracker, readMaxMindTrackingToken } from '@/modules/fraud/maxmin
1010
import { resolveOrg } from '@/resources/shared/resolve-org';
1111
import { registerWithPassword } from '@/resources/signup';
1212
import { signupPasswordSchemaFor } from '@/resources/signup/signup.schema';
13+
import { paths } from '@/routes/paths';
1314
import { providerForRequest } from '@/server/auth-context.server';
1415
import { loaderCsrf, assertCsrf } from '@/server/csrf';
1516
import { requireEmailVerification } from '@/server/env';
@@ -30,7 +31,7 @@ import {
3031
type LoaderFunctionArgs,
3132
type MetaFunction,
3233
} from 'react-router';
33-
import { Form as RRForm } from 'react-router';
34+
import { Form as RRForm, Link } from 'react-router';
3435

3536
export const meta: MetaFunction = () => [{ title: 'Set a password' }];
3637

@@ -164,6 +165,12 @@ export default function SignupPassword() {
164165
// replaces the per-route toast).
165166
const errorMessage = useAuthActionError(actionData);
166167

168+
// "Not you?" returns to the signup start (not /login — this is a signup ceremony) so a
169+
// different email can be entered. Mirrors IdentityBadge's requestId/organization threading,
170+
// loginName intentionally dropped. AuthCeremony's shared IdentityBadge is login-only copy
171+
// ("Signing in as" → /login), so the identity + link are rendered inline here instead.
172+
const notYouHref = paths.signup.index({ requestId, organization });
173+
167174
if (actionData && 'sent' in actionData) {
168175
return (
169176
<AuthCard
@@ -183,7 +190,14 @@ export default function SignupPassword() {
183190
<MaxMindTracker accountId={maxmindAccountId} />
184191
<AuthCeremony
185192
title={<Trans>Set a password</Trans>}
186-
description={<Trans>You'll need to set a password to complete your signup.</Trans>}
193+
description={
194+
<>
195+
<Trans>Signing up as</Trans> <strong>{loginName}</strong>.{' '}
196+
<Link to={notYouHref} className="underline">
197+
<Trans>Not you?</Trans>
198+
</Link>
199+
</>
200+
}
187201
error={errorMessage}>
188202
<Form.Root
189203
schema={schema}

cypress/component/routes/signup/password-render.cy.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,12 @@ describe('signup/password — render adoption', () => {
5050
'/signup'
5151
);
5252
});
53+
54+
it('shows the identity being registered with a "Not you?" link back to /signup', () => {
55+
mountPassword();
56+
cy.contains(LOADER_DATA.loginName, { timeout: 6000 }).should('exist');
57+
cy.findByRole('link', { name: /not you/i })
58+
.should('have.attr', 'href')
59+
.and('match', /^\/signup(\?|$)/);
60+
});
5361
});

0 commit comments

Comments
 (0)