Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions integration/testUtils/usersService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export type UserService = {
createFakeOrganization: (userId: string) => Promise<FakeOrganization>;
getUser: (opts: { id?: string; email?: string }) => Promise<User | undefined>;
createFakeAPIKey: (userId: string) => Promise<FakeAPIKey>;
passwordUntrusted: (userId: string) => Promise<void>;
passwordCompromised: (userId: string) => Promise<void>;
};

/**
Expand Down Expand Up @@ -211,8 +211,8 @@ export const createUserService = (clerkClient: ClerkClient) => {
revoke: () => clerkClient.apiKeys.revoke({ apiKeyId: apiKey.id, revocationReason: 'For testing purposes' }),
} satisfies FakeAPIKey;
},
passwordUntrusted: async (userId: string) => {
await clerkClient.users.__experimental_passwordUntrusted(userId);
passwordCompromised: async (userId: string) => {
await clerkClient.users.__experimental_passwordCompromised(userId);
},
};

Expand Down
26 changes: 20 additions & 6 deletions integration/tests/session-tasks-sign-in-reset-password.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test } from '@playwright/test';
import { expect, test } from '@playwright/test';

import { hash } from '../models/helpers';
import { appConfigs } from '../presets';
Expand All @@ -19,7 +19,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasksResetPassword
const user = u.services.users.createFakeUser();
const createdUser = await u.services.users.createBapiUser(user);

await u.services.users.passwordUntrusted(createdUser.id);
await u.services.users.passwordCompromised(createdUser.id);

// Performs sign-in
await u.po.signIn.goTo();
Expand All @@ -28,6 +28,13 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasksResetPassword
await u.po.signIn.setPassword(user.password);
await u.po.signIn.continue();

await expect(
u.page.getByText(
"Your password appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
),
).toBeVisible();
await u.po.signIn.getAltMethodsEmailCodeButton().click();

await u.page.getByRole('textbox', { name: 'code' }).click();
await u.page.keyboard.type('424242', { delay: 100 });

Expand Down Expand Up @@ -59,10 +66,11 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasksResetPassword
const user = u.services.users.createFakeUser();
const createdUser = await u.services.users.createBapiUser(user);

await u.services.users.passwordUntrusted(createdUser.id);
await u.services.users.passwordCompromised(createdUser.id);
const fakeOrganization = u.services.organizations.createFakeOrganization();
await u.services.organizations.createBapiOrganization({
...fakeOrganization,
name: fakeOrganization.name,
slug: fakeOrganization.slug + Date.now().toString(),
createdBy: createdUser.id,
});

Expand All @@ -73,9 +81,15 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasksResetPassword
await u.po.signIn.setPassword(user.password);
await u.po.signIn.continue();

await u.page.getByRole('textbox', { name: 'code' }).fill('424242');
await expect(
u.page.getByText(
"Your password appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
),
).toBeVisible();
await u.po.signIn.getAltMethodsEmailCodeButton().click();

await u.po.expect.toBeSignedIn();
await u.page.getByRole('textbox', { name: 'code' }).click();
await u.page.keyboard.type('424242', { delay: 100 });

// Redirects back to tasks when accessing protected route by `auth.protect`
await u.page.goToRelative('/page-protected');
Expand Down
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
7 changes: 7 additions & 0 deletions packages/localizations/src/ar-SA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,15 @@ export const arSA: LocalizationResource = {
subtitle: 'للمتابعة إلى {{applicationName}}',
title: 'ادخل كلمة المرور',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'كلمة المرور غير آمنة',
},
passwordUntrusted: {
title: undefined,
},
phoneCode: {
formTitle: 'رمز التحقق',
resendButton: 'لم يصلك الرمز؟ حاول مرة أخرى',
Expand Down Expand Up @@ -895,6 +901,7 @@ export const arSA: LocalizationResource = {
form_password_pwned__sign_in: 'لا يمكن أستعمال كلمة السر هذه لانها غير أمنة, الرجاء اختيار كلمة مرور أخرى',
form_password_size_in_bytes_exceeded:
'تجاوزت كلمة المرور الحد الأقصى للحروف المدخلة, الرجاء أدخال كلمة مرور أقصر أو حذف بعض الأحرف الخاصة',
form_password_untrusted__sign_in: undefined,
form_password_validation_failed: 'كلمة مرور خاطئة',
form_username_invalid_character: undefined,
form_username_invalid_length: undefined,
Expand Down
7 changes: 7 additions & 0 deletions packages/localizations/src/be-BY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,9 +697,15 @@ export const beBY: LocalizationResource = {
subtitle: 'каб працягнуць працу ў "{{applicationName}}"',
title: 'Увядзіце пароль',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Пароль быў узламаны',
},
passwordUntrusted: {
title: undefined,
},
phoneCode: {
formTitle: 'Код верыфікацыі',
resendButton: 'Пераадправіць код',
Expand Down Expand Up @@ -904,6 +910,7 @@ export const beBY: LocalizationResource = {
form_password_pwned__sign_in: 'Гэты пароль быў узламаны, калі ласка, абярыце іншы.',
form_password_size_in_bytes_exceeded:
'Ваш пароль перавышае максімальна дапушчальнае колькасць байтаў, скараціце яго або выдаліце некаторыя спецыяльныя сімвалы.',
form_password_untrusted__sign_in: undefined,
form_password_validation_failed: 'Неверагодны пароль',
form_username_invalid_character: 'Імя карыстальніка змяшчае недапушчальныя сімвалы.',
form_username_invalid_length: 'Імя карыстальніка павінна быць ад 3 да 50 сімвалаў.',
Expand Down
7 changes: 7 additions & 0 deletions packages/localizations/src/bg-BG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,15 @@ export const bgBG: LocalizationResource = {
subtitle: 'Въведете паролата, свързана с вашия акаунт',
title: 'Въведете вашата парола',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: undefined,
},
passwordUntrusted: {
title: undefined,
},
phoneCode: {
formTitle: 'Код за потвърждение',
resendButton: 'Не сте получили код? Изпрати отново',
Expand Down Expand Up @@ -897,6 +903,7 @@ export const bgBG: LocalizationResource = {
form_password_pwned: 'Тази парола е компрометирана в изтекли данни. Моля, изберете друга.',
form_password_pwned__sign_in: undefined,
form_password_size_in_bytes_exceeded: 'Паролата ви е твърде дълга. Моля, съкратете я.',
form_password_untrusted__sign_in: undefined,
form_password_validation_failed: 'Невалидна парола.',
form_username_invalid_character: 'Потребителското име съдържа невалидни символи.',
form_username_invalid_length: 'Потребителското име трябва да бъде между 3 и 256 символа.',
Expand Down
7 changes: 7 additions & 0 deletions packages/localizations/src/bn-IN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,15 @@ export const bnIN: LocalizationResource = {
subtitle: 'আপনার অ্যাকাউন্টের সাথে যুক্ত পাসওয়ার্ড লিখুন',
title: 'আপনার পাসওয়ার্ড লিখুন',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'পাসওয়ার্ড সমঝোতা হয়েছে',
},
passwordUntrusted: {
title: undefined,
},
phoneCode: {
formTitle: 'যাচাইকরণ কোড',
resendButton: 'কোনো কোড পাননি? পুনরায় পাঠান',
Expand Down Expand Up @@ -906,6 +912,7 @@ export const bnIN: LocalizationResource = {
'এই পাসওয়ার্ডটি একটি ডেটা লঙ্ঘনের অংশ হিসাবে পাওয়া গেছে এবং ব্যবহার করা যাবে না, দয়া করে আপনার পাসওয়ার্ড রিসেট করুন।',
form_password_size_in_bytes_exceeded:
'আপনার পাসওয়ার্ড অনুমোদিত সর্বাধিক বাইট সংখ্যা অতিক্রম করেছে, দয়া করে এটি ছোট করুন বা কিছু বিশেষ অক্ষর সরান।',
form_password_untrusted__sign_in: undefined,
form_password_validation_failed: 'ভুল পাসওয়ার্ড',
form_username_invalid_character:
'আপনার ব্যবহারকারীর নামে অবৈধ অক্ষর রয়েছে। দয়া করে শুধুমাত্র অক্ষর, সংখ্যা এবং আন্ডারস্কোর ব্যবহার করুন।',
Expand Down
7 changes: 7 additions & 0 deletions packages/localizations/src/ca-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,15 @@ export const caES: LocalizationResource = {
subtitle: 'Introdueix la contrasenya associada al teu compte',
title: 'Introdueix la teva contrasenya',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: undefined,
},
passwordUntrusted: {
title: undefined,
},
phoneCode: {
formTitle: 'Codi de verificació',
resendButton: 'No has rebut el codi? Reenvia',
Expand Down Expand Up @@ -899,6 +905,7 @@ export const caES: LocalizationResource = {
form_password_pwned__sign_in: undefined,
form_password_size_in_bytes_exceeded:
'La teva contrasenya ha superat el nombre màxim de bytes permesos, si us plau, redueix-la o elimina alguns caràcters especials.',
form_password_untrusted__sign_in: undefined,
form_password_validation_failed: 'Contrasenya incorrecta',
form_username_invalid_character: "El nom d'usuari conté caràcters no vàlids.",
form_username_invalid_length: "El nom d'usuari ha de tenir entre 3 i 50 caràcters.",
Expand Down
7 changes: 7 additions & 0 deletions packages/localizations/src/cs-CZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,15 @@ export const csCZ: LocalizationResource = {
subtitle: 'Zadejte heslo spojené s vaším účtem',
title: 'Zadejte své heslo',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Heslo kompromitováno',
},
passwordUntrusted: {
title: undefined,
},
phoneCode: {
formTitle: 'Ověřovací kód',
resendButton: 'Neobdrželi jste kód? Znovu poslat',
Expand Down Expand Up @@ -910,6 +916,7 @@ export const csCZ: LocalizationResource = {
'Toto heslo bylo nalezeno jako součást prolomení a nelze ho použít, prosím resetujte si heslo.',
form_password_size_in_bytes_exceeded:
'Vaše heslo překročilo maximální povolený počet bajtů, prosím zkrátit ho nebo odstranit některé speciální znaky.',
form_password_untrusted__sign_in: undefined,
form_password_validation_failed: 'Nesprávné heslo',
form_username_invalid_character: 'Uživatelské jméno může obsahovat pouze alfanumerické znaky a podtržítka.',
form_username_invalid_length: 'Vaše uživatelské jméno musí mít mezi {{min_length}} a {{max_length}} znaky.',
Expand Down
7 changes: 7 additions & 0 deletions packages/localizations/src/da-DK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,9 +692,15 @@ export const daDK: LocalizationResource = {
subtitle: 'Fortsæt til {{applicationName}}',
title: 'Indtast din adgangskode',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Sikkerhedsadvarsel',
},
passwordUntrusted: {
title: undefined,
},
phoneCode: {
formTitle: 'Bekræftelseskode',
resendButton: 'Send kode igen',
Expand Down Expand Up @@ -896,6 +902,7 @@ export const daDK: LocalizationResource = {
form_password_pwned__sign_in: 'Din adgangskode er blevet kompromitteret, vælg en ny.',
form_password_size_in_bytes_exceeded:
'Din adgangskode har overskredet det maksimalt tilladte antal bytes, forkort den eller fjern nogle specialtegn.',
form_password_untrusted__sign_in: undefined,
form_password_validation_failed: 'Forkert adgangskode.',
form_username_invalid_character: 'Brugernavnet indeholder ugyldige tegn.',
form_username_invalid_length: 'Brugernavnet har en ugyldig længde.',
Expand Down
7 changes: 7 additions & 0 deletions packages/localizations/src/de-DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,9 +706,15 @@ export const deDE: LocalizationResource = {
subtitle: 'weiter zu {{applicationName}}',
title: 'Geben Sie Ihr Passwort ein',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Passwort kompromittiert',
},
passwordUntrusted: {
title: undefined,
},
phoneCode: {
formTitle: 'Bestätigungscode',
resendButton: 'Code erneut senden',
Expand Down Expand Up @@ -915,6 +921,7 @@ export const deDE: LocalizationResource = {
'Dieses Passwort wurde in einem Datenleck gefunden und kann nicht verwendet werden. Bitte setzen Sie Ihr Passwort zurück.',
form_password_size_in_bytes_exceeded:
'Das Passwort hat die maximale Anzahl an Bytes überschritten. Bitte kürzen oder Sonderzeichen entfernen.',
form_password_untrusted__sign_in: undefined,
form_password_validation_failed: 'Falsches Passwort.',
form_username_invalid_character:
'Der Benutzername enthält ungültige Zeichen. Bitte verwenden Sie nur alphanumerische Zeichen und Unterstriche.',
Expand Down
7 changes: 7 additions & 0 deletions packages/localizations/src/el-GR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,9 +694,15 @@ export const elGR: LocalizationResource = {
subtitle: 'για να συνεχίσετε στο {{applicationName}}',
title: 'Εισαγωγή κωδικού πρόσβασης',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Παραβιασμένος κωδικός',
},
passwordUntrusted: {
title: undefined,
},
phoneCode: {
formTitle: 'Κωδικός επαλήθευσης',
resendButton: 'Δεν λάβατε κωδικό; Αποστολή ξανά',
Expand Down Expand Up @@ -901,6 +907,7 @@ export const elGR: LocalizationResource = {
form_password_pwned__sign_in: undefined,
form_password_size_in_bytes_exceeded:
'Ο κωδικός πρόσβασής σας έχει υπερβεί το μέγιστο αριθμό bytes που επιτρέπεται. Παρακαλούμε, συντομεύστε τον ή αφαιρέστε μερικούς ειδικούς χαρακτήρες.',
form_password_untrusted__sign_in: undefined,
form_password_validation_failed: 'Λανθασμένος κωδικός',
form_username_invalid_character: undefined,
form_username_invalid_length: undefined,
Expand Down
7 changes: 7 additions & 0 deletions packages/localizations/src/en-GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,9 +694,15 @@ export const enGB: LocalizationResource = {
subtitle: 'Enter the password associated with your account',
title: 'Enter your password',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Password compromised',
},
passwordUntrusted: {
title: undefined,
},
phoneCode: {
formTitle: 'Verification code',
resendButton: "Didn't receive a code? Resend",
Expand Down Expand Up @@ -902,6 +908,7 @@ export const enGB: LocalizationResource = {
'This password has been found as part of a breach and can not be used, please reset your password.',
form_password_size_in_bytes_exceeded:
'Your password has exceeded the maximum number of bytes allowed, please shorten it or remove some special characters.',
form_password_untrusted__sign_in: undefined,
form_password_validation_failed: 'Incorrect Password',
form_username_invalid_character:
'Your username contains invalid characters. Please use only letters, numbers, and underscores.',
Expand Down
10 changes: 10 additions & 0 deletions packages/localizations/src/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,15 @@ 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 untrusted',
},
phoneCode: {
formTitle: 'Verification code',
resendButton: "Didn't receive a code? Resend",
Expand Down Expand Up @@ -897,6 +903,10 @@ export const enUS: LocalizationResource = {
form_password_pwned__sign_in:
'This password has been found as part of a breach and can not be used, please reset your password.',
form_password_size_in_bytes_exceeded: undefined,
form_password_compromised__sign_in:
"Your password appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
form_password_untrusted__sign_in:
"Your password appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue.",
form_password_validation_failed: undefined,
form_username_invalid_character: undefined,
form_username_invalid_length: 'Your username must be between {{min_length}} and {{max_length}} characters long.',
Expand Down
7 changes: 7 additions & 0 deletions packages/localizations/src/es-CR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,15 @@ export const esCR: LocalizationResource = {
subtitle: 'para continuar con {{applicationName}}',
title: 'Introduzca su contraseña',
},
passwordCompromised: {
title: undefined,
},
passwordPwned: {
title: 'Contraseña en peligro',
},
passwordUntrusted: {
title: undefined,
},
phoneCode: {
formTitle: 'Código de verificación',
resendButton: 'Reenviar código',
Expand Down Expand Up @@ -907,6 +913,7 @@ export const esCR: LocalizationResource = {
'Esta contraseña se encontró como parte de una brecha y no se puede utilizar, por favor restablece tu contraseña.',
form_password_size_in_bytes_exceeded:
'La contraseña excede el número máximo de bytes permitidos. Por favor, elimine algunos caracteres especiales o reduzca la longitud de la contraseña.',
form_password_untrusted__sign_in: undefined,
form_password_validation_failed: 'Contraseña incorrecta',
form_username_invalid_character: 'El nombre de usuario contiene caracteres inválidos.',
form_username_invalid_length: 'La longitud del nombre de usuario es demasiado corta.',
Expand Down
Loading
Loading