Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/honest-pigs-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/backend': patch
---

Rename `__experimental_passwordUntrusted` to `__experimental_passwordCompromised`
5 changes: 5 additions & 0 deletions .changeset/moody-dryers-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/localizations': patch
---

Deprecating `passwordUntrusted` in favour of `passwordCompromised` and `form_password_untrusted__sign_in` to `form_password_compromised__sign_in`
6 changes: 6 additions & 0 deletions .changeset/some-phones-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@clerk/clerk-js': patch
'@clerk/shared': patch
---

Rename internal `isPasswordUntrustedError` to `isPasswordCompromisedError`
4 changes: 2 additions & 2 deletions packages/backend/src/api/endpoints/UserApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,11 @@ export class UserAPI extends AbstractAPI {
});
}

public async __experimental_passwordUntrusted(userId: string) {
public async __experimental_passwordCompromised(userId: string) {
this.requireId(userId);
return this.request<User>({
method: 'POST',
path: joinPaths(basePath, userId, 'password_untrusted'),
path: joinPaths(basePath, userId, 'password_compromised'),
bodyParams: {
revokeAllSessions: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { SignInSocialButtons } from './SignInSocialButtons';
import { useResetPasswordFactor } from './useResetPasswordFactor';
import { withHavingTrouble } from './withHavingTrouble';

export type AlternativeMethodsMode = 'forgot' | 'pwned' | 'passwordUntrusted' | 'default';
export type AlternativeMethodsMode = 'forgot' | 'pwned' | 'passwordCompromised' | 'default';

export type AlternativeMethodsProps = {
onBackLinkClick: React.MouseEventHandler | undefined;
Expand Down Expand Up @@ -55,7 +55,7 @@ const AlternativeMethodsList = (props: AlternativeMethodListProps) => {
<Card.Content>
<Header.Root showLogo>
<Header.Title localizationKey={cardTitleKey} />
{!isReset && mode !== 'passwordUntrusted' && (
{!isReset && mode !== 'passwordCompromised' && (
<Header.Subtitle localizationKey={localizationKeys('signIn.alternativeMethods.subtitle')} />
)}
</Header.Root>
Expand Down Expand Up @@ -185,8 +185,8 @@ function determineFlowPart(mode: AlternativeMethodsMode) {
return 'forgotPasswordMethods';
case 'pwned':
return 'passwordPwnedMethods';
case 'passwordUntrusted':
return 'passwordUntrustedMethods';
case 'passwordCompromised':
return 'passwordCompromisedMethods';
default:
return 'alternativeMethods';
}
Expand All @@ -198,8 +198,8 @@ function determineTitle(mode: AlternativeMethodsMode): LocalizationKey {
return localizationKeys('signIn.forgotPasswordAlternativeMethods.title');
case 'pwned':
return localizationKeys('signIn.passwordPwned.title');
case 'passwordUntrusted':
return localizationKeys('signIn.passwordPwned.title');
case 'passwordCompromised':
return localizationKeys('signIn.passwordCompromised.title');
default:
return localizationKeys('signIn.alternativeMethods.title');
}
Expand All @@ -210,7 +210,7 @@ function determineIsReset(mode: AlternativeMethodsMode): boolean {
case 'forgot':
case 'pwned':
return true;
case 'passwordUntrusted':
case 'passwordCompromised':
return false;
default:
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ function determineAlternativeMethodsMode(
return 'pwned';
}

if (passwordErrorCode === 'untrusted') {
return 'passwordUntrusted';
if (passwordErrorCode === 'compromised') {
return 'passwordCompromised';
}

return 'forgot';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isPasswordPwnedError, isPasswordUntrustedError, isUserLockedError } from '@clerk/shared/error';
import { isPasswordCompromisedError, isPasswordPwnedError, isUserLockedError } from '@clerk/shared/error';
import { useClerk } from '@clerk/shared/react';
import React from 'react';

Expand All @@ -18,7 +18,7 @@ import { useRouter } from '../../router/RouteContext';
import { HavingTrouble } from './HavingTrouble';
import { useResetPasswordFactor } from './useResetPasswordFactor';

export type PasswordErrorCode = 'untrusted' | 'pwned';
export type PasswordErrorCode = 'compromised' | 'pwned';

type SignInFactorOnePasswordProps = {
onForgotPasswordMethodClick: React.MouseEventHandler | undefined;
Expand Down Expand Up @@ -101,9 +101,9 @@ export const SignInFactorOnePasswordCard = (props: SignInFactorOnePasswordProps)
return;
}

if (isPasswordUntrustedError(err)) {
card.setError({ ...err.errors[0], code: 'form_password_untrusted__sign_in' });
onPasswordError('untrusted');
if (isPasswordCompromisedError(err)) {
card.setError({ ...err.errors[0], code: 'form_password_compromised__sign_in' });
onPasswordError('compromised');
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ describe('SignInFactorOne', () => {
).not.toBeInTheDocument();
});

it('using an untrusted password should show the untrusted password screen', async () => {
it('using an compromised password should show the compromised password screen', async () => {
Comment thread
octoper marked this conversation as resolved.
const { wrapper, fixtures } = await createFixtures(f => {
f.withEmailAddress();
f.withPassword();
Expand All @@ -367,7 +367,7 @@ describe('SignInFactorOne', () => {
fixtures.signIn.prepareFirstFactor.mockReturnValueOnce(Promise.resolve({} as SignInResource));

const errJSON = {
code: 'form_password_untrusted',
code: 'form_password_compromised',
long_message:
"Your password appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
message:
Expand All @@ -393,7 +393,7 @@ describe('SignInFactorOne', () => {
await screen.findByText('Email code to hello@clerk.com');
});

it('Prompts the user to use a different method if the password is untrusted', async () => {
it('Prompts the user to use a different method if the password is compromised', async () => {
const { wrapper, fixtures } = await createFixtures(f => {
f.withEmailAddress();
f.withPassword();
Expand All @@ -408,7 +408,7 @@ describe('SignInFactorOne', () => {
fixtures.signIn.prepareFirstFactor.mockReturnValueOnce(Promise.resolve({} as SignInResource));

const errJSON = {
code: 'form_password_untrusted',
code: 'form_password_compromised',
long_message:
"Your password appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
message:
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui/elements/contexts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export type FlowMetadata = {
| 'alternativeMethods'
| 'forgotPasswordMethods'
| 'passwordPwnedMethods'
| 'passwordUntrustedMethods'
| 'passwordCompromisedMethods'
| 'havingTrouble'
| 'ssoCallback'
| 'popupCallback'
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/ar-SA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,9 @@ export const arSA: LocalizationResource = {
subtitle: 'للمتابعة إلى {{applicationName}}',
title: 'ادخل كلمة المرور',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'كلمة المرور غير آمنة',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/be-BY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,9 @@ export const beBY: LocalizationResource = {
subtitle: 'каб працягнуць працу ў "{{applicationName}}"',
title: 'Увядзіце пароль',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Пароль быў узламаны',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/bg-BG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,9 @@ export const bgBG: LocalizationResource = {
subtitle: 'Въведете паролата, свързана с вашия акаунт',
title: 'Въведете вашата парола',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: undefined,
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/bn-IN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ export const bnIN: LocalizationResource = {
subtitle: 'আপনার অ্যাকাউন্টের সাথে যুক্ত পাসওয়ার্ড লিখুন',
title: 'আপনার পাসওয়ার্ড লিখুন',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'পাসওয়ার্ড সমঝোতা হয়েছে',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/ca-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,9 @@ export const caES: LocalizationResource = {
subtitle: 'Introdueix la contrasenya associada al teu compte',
title: 'Introdueix la teva contrasenya',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: undefined,
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/cs-CZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,9 @@ export const csCZ: LocalizationResource = {
subtitle: 'Zadejte heslo spojené s vaším účtem',
title: 'Zadejte své heslo',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Heslo kompromitováno',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/da-DK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,9 @@ export const daDK: LocalizationResource = {
subtitle: 'Fortsæt til {{applicationName}}',
title: 'Indtast din adgangskode',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Sikkerhedsadvarsel',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/de-DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,9 @@ export const deDE: LocalizationResource = {
subtitle: 'weiter zu {{applicationName}}',
title: 'Geben Sie Ihr Passwort ein',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Passwort kompromittiert',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/el-GR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,9 @@ export const elGR: LocalizationResource = {
subtitle: 'για να συνεχίσετε στο {{applicationName}}',
title: 'Εισαγωγή κωδικού πρόσβασης',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Παραβιασμένος κωδικός',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/en-GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,9 @@ export const enGB: LocalizationResource = {
subtitle: 'Enter the password associated with your account',
title: 'Enter your password',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Password compromised',
},
Expand Down
5 changes: 4 additions & 1 deletion packages/localizations/src/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,11 +691,14 @@ export const enUS: LocalizationResource = {
subtitle: 'Enter the password associated with your account',
title: 'Enter your password',
},
passwordCompromised: {
title: 'Password compromised',
},
passwordPwned: {
title: 'Password compromised',
},
passwordUntrusted: {
title: 'Password compromised',
title: 'Password untrusted',
},
phoneCode: {
formTitle: 'Verification code',
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/es-CR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,9 @@ export const esCR: LocalizationResource = {
subtitle: 'para continuar con {{applicationName}}',
title: 'Introduzca su contraseña',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Contraseña en peligro',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,9 @@ export const esES: LocalizationResource = {
subtitle: 'para continuar a {{applicationName}}',
title: 'Introduzca su contraseña',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Tu contraseña ha sido comprometida',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/es-MX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,9 @@ export const esMX: LocalizationResource = {
subtitle: 'para continuar con {{applicationName}}',
title: 'Introduzca su contraseña',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Contraseña en peligro',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/es-UY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,9 @@ export const esUY: LocalizationResource = {
subtitle: 'Ingresá la contraseña asociada a tu cuenta',
title: 'Ingresá tu contraseña',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Contraseña comprometida',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/fa-IR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,9 @@ export const faIR: LocalizationResource = {
subtitle: 'رمز عبور مرتبط با حساب کاربری خود را وارد کنید',
title: 'رمز عبور خود را وارد کنید',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'رمز عبور به خطر افتاده است',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/fi-FI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,9 @@ export const fiFI: LocalizationResource = {
subtitle: 'Syötä tilisi salasana',
title: 'Syötä salasanasi',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Salasana kompromisoitu',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/fr-FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,9 @@ export const frFR: LocalizationResource = {
subtitle: 'pour continuer vers {{applicationName}}',
title: 'Tapez votre mot de passe',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Mot de passe compromis',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/he-IL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,9 @@ export const heIL: LocalizationResource = {
subtitle: 'להמשיך אל {{applicationName}}',
title: 'הכנס את סיסמתך',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: undefined,
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/hi-IN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,9 @@ export const hiIN: LocalizationResource = {
subtitle: 'अपने खाते से जुड़ा पासवर्ड दर्ज करें',
title: 'अपना पासवर्ड दर्ज करें',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'पासवर्ड समझौता हो गया',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/hr-HR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,9 @@ export const hrHR: LocalizationResource = {
subtitle: 'Unesite lozinku povezanu s vašim računom',
title: 'Unesite svoju lozinku',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Lozinka je kompromitirana',
},
Expand Down
3 changes: 3 additions & 0 deletions packages/localizations/src/hu-HU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,9 @@ export const huHU: LocalizationResource = {
subtitle: 'Írd be a fiókhoz tartozó jelszavad',
title: 'Írd be a jelszavad',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Jelszó kompromitálódott',
},
Expand Down
Loading
Loading