Skip to content
Open
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
10 changes: 1 addition & 9 deletions api/src/dtos/auth/update-password.dto.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { IsString, Matches, MaxLength } from 'class-validator';
import { IsString, Matches } from 'class-validator';
import { Expose } from 'class-transformer';
import { ValidationsGroupsEnum } from '../../enums/shared/validation-groups-enum';
import { passwordRegex } from '../../utilities/password-regex';
import { Match } from '../../decorators/match-decorator';
import { ApiProperty } from '@nestjs/swagger';

export class UpdatePassword {
Expand All @@ -15,13 +14,6 @@ export class UpdatePassword {
})
password: string;

@Expose()
@ApiProperty()
@IsString({ groups: [ValidationsGroupsEnum.default] })
@MaxLength(64, { groups: [ValidationsGroupsEnum.default] })
@Match('password')
passwordConfirmation: string;

@Expose()
@ApiProperty()
@IsString({ groups: [ValidationsGroupsEnum.default] })
Expand Down
9 changes: 1 addition & 8 deletions api/src/dtos/users/public-user-create.dto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ApiProperty, ApiPropertyOptional, OmitType } from '@nestjs/swagger';
import { PublicUserUpdate } from './public-user-update.dto';
import { Expose } from 'class-transformer';
import { IsEmail, IsString, Matches, MaxLength } from 'class-validator';
import { IsEmail, IsString, Matches } from 'class-validator';
import { ValidationsGroupsEnum } from '../../enums/shared/validation-groups-enum';
import { passwordRegex } from '../../utilities/password-regex';
import { Match } from '../../decorators/match-decorator';
Expand Down Expand Up @@ -30,13 +30,6 @@ export class PublicUserCreate extends OmitType(PublicUserUpdate, [
})
password: string;

@Expose()
@IsString({ groups: [ValidationsGroupsEnum.default] })
@MaxLength(64, { groups: [ValidationsGroupsEnum.default] })
@Match('password', { groups: [ValidationsGroupsEnum.default] })
@ApiProperty()
passwordConfirmation: string;

@Expose()
@ApiPropertyOptional()
@IsEmail({}, { groups: [ValidationsGroupsEnum.default] })
Expand Down
1 change: 0 additions & 1 deletion api/test/integration/auth.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ describe('Auth Controller Tests', () => {
.send({
email: storedUser.email,
password: 'Abcdef12345!',
passwordConfirmation: 'Abcdef12345!',
token,
} as UpdatePassword)
.expect(200);
Expand Down
1 change: 0 additions & 1 deletion api/test/integration/permission-tests/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ export const buildUserCreateMock = (
firstName: 'Public User firstName',
lastName: 'Public User lastName',
password: 'Abcdef12345!',
passwordConfirmation: 'Abcdef12345!',
dob: new Date(),
agreedToTermsOfService: true,
email,
Expand Down
1 change: 0 additions & 1 deletion api/test/integration/user.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,6 @@ describe('User Controller Tests', () => {
firstName: 'Public First Name',
lastName: 'Public Last Name',
password: 'Abcdef12345!',
passwordConfirmation: 'Abcdef12345!',
email: 'publicUser@email.com',
emailConfirmation: 'publicUser@email.com',
language: LanguagesEnum.es,
Expand Down
2 changes: 0 additions & 2 deletions api/test/unit/services/auth.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,6 @@ describe('Testing auth service', () => {
await authService.updatePassword(
{
password: 'Abcdef12345!',
passwordConfirmation: 'Abcdef12345!',
token,
},
response as unknown as Response,
Expand Down Expand Up @@ -1057,7 +1056,6 @@ describe('Testing auth service', () => {
await authService.updatePassword(
{
password: 'Abcdef12345!',
passwordConfirmation: 'Abcdef12345!',
token,
},
response as unknown as Response,
Expand Down
2 changes: 0 additions & 2 deletions api/test/unit/services/user.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2869,7 +2869,6 @@ describe('Testing user service', () => {
firstName: 'public User firstName',
lastName: 'public User lastName',
password: 'Abcdef12345!',
passwordConfirmation: 'Abcdef12345!',
agreedToTermsOfService: true,
dob: new Date('2000-01-01'),
email: 'publicUser@email.com',
Expand Down Expand Up @@ -2996,7 +2995,6 @@ describe('Testing user service', () => {
firstName: 'public User firstName',
lastName: 'public User lastName',
password: 'Abcdef12345!',
passwordConfirmation: 'Abcdef12345!',
agreedToTermsOfService: true,
dob: new Date('2000-01-01'),
email: 'publicUser@email.com',
Expand Down
9 changes: 2 additions & 7 deletions shared-helpers/src/auth/AuthContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@
forPartners?: boolean,
reCaptchaToken?: string
) => Promise<User | undefined>
resetPassword: (
token: string,
password: string,
passwordConfirmation: string
) => Promise<User | undefined>
resetPassword: (token: string, password: string) => Promise<User | undefined>
signOut: () => Promise<void>
confirmAccount: (token: string) => Promise<User | undefined>
forgotPassword: (email: string, listingIdRedirect?: string) => Promise<boolean | undefined>
Expand Down Expand Up @@ -143,7 +139,7 @@
)

const axiosConfig = (router: GenericRouter) => {
return axiosStatic.create({

Check warning on line 142 in shared-helpers/src/auth/AuthContext.ts

View workflow job for this annotation

GitHub Actions / Run linters

Caution: `axiosStatic` also has a named export `create`. Check if you meant to write `import {create} from 'axios'` instead
baseURL: "/api/adapter",
withCredentials: true,
headers: {
Expand Down Expand Up @@ -311,14 +307,13 @@
dispatch(saveProfile(null))
dispatch(signOut())
},
resetPassword: async (token, password, passwordConfirmation) => {
resetPassword: async (token, password) => {
dispatch(startLoading())
try {
const response = await authService?.updatePassword({
body: {
token,
password,
passwordConfirmation,
},
})
if (response) {
Expand Down
6 changes: 0 additions & 6 deletions shared-helpers/src/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@
"account.settings.alerts.genericError": "حدث خطأ. يرجى المحاولة مرة أخرى، أو الاتصال بالدعم عبر البريد الإلكتروني %{contactEmail} للحصول على المساعدة.",
"account.settings.alerts.nameSuccess": "تم تحديث الاسم بنجاح",
"account.settings.alerts.passwordEmpty": "لا يجوز أن تكون حقول كلمة المرور فارغة",
"account.settings.alerts.passwordMatch": "حقول كلمة المرور الجديدة غير متطابقة",
"account.settings.alerts.passwordSuccess": "تم تحديث كلمة المرور بنجاح",
"account.settings.confirmNewPassword": "تأكيد كلمة المرور الجديدة",
"account.settings.currentPassword": "كلمة المرور الحالي",
"account.settings.myNotification": "إشعاراتي",
"account.settings.myProfile": "ملفي الشخصي",
Expand Down Expand Up @@ -593,15 +591,13 @@
"authentication.createAccount.errors.emailNotFound": "البريد الإلكتروني غير موجود. الرجاء التسجيل أولا.",
"authentication.createAccount.errors.errorSaving": "عفواً! يبدو أن هناك خطأ ما. يُرجى المحاولة مرة أخرى. \n\nتواصل مع إدارة الإسكان إذا كنت لا تزال تواجه مشاكل.",
"authentication.createAccount.errors.generic": "حدث خطأ أثناء إنشاء حسابك. يُرجى المحاولة مرة أخرى.\n\nتواصل مع إدارة الإسكان إذا كنت لا تزال تواجه مشاكل.",
"authentication.createAccount.errors.passwordMismatch": "كلمات السر لا تتطابق",
"authentication.createAccount.errors.passwordTooWeak": "كلمة المرور ضعيفة جدا. يجب أن يتكون من 8 أحرف على الأقل وأن يتضمن حرفًا واحدًا على الأقل ورقمًا واحدًا على الأقل.",
"authentication.createAccount.errors.tokenExpired": "انتهت صلاحية الرابط الخاص بك.",
"authentication.createAccount.linkExpired": "انتهت صلاحية الرابط الخاص بك",
"authentication.createAccount.noAccount": "ليس لديك حساب؟",
"authentication.createAccount.password": "كلمة المرور",
"authentication.createAccount.passwordInfo": "يجب أن يتكون من 8 أحرف على الأقل وأن يتضمن حرفًا واحدًا على الأقل ورقمًا واحدًا على الأقل.",
"authentication.createAccount.reEnterEmail": "أعد إدخال البريد الإلكتروني",
"authentication.createAccount.reEnterPassword": "إعادة إدخال كلمة المرور الخاصة بك",
"authentication.createAccount.resendAnEmailTo": "إعادة إرسال بريد إلكتروني إلى",
"authentication.createAccount.resendEmailInfo": "يرجى النقر فوق الارتباط الموجود في البريد الإلكتروني الذي نرسله إليك في غضون 24 ساعة لإكمال إنشاء الحساب.",
"authentication.createAccount.resendTheEmail": "إعادة إرسال البريد الإلكتروني",
Expand All @@ -612,7 +608,6 @@
"authentication.forgotPassword.errors.tokenExpired": "انتهت صلاحية رمز إعادة تعيين كلمة المرور. الرجاء طلب واحدة جديدة.",
"authentication.forgotPassword.errors.tokenMissing": "لم يتم العثور على الرمز. الرجاء طلب واحدة جديدة.",
"authentication.forgotPassword.message": "إذا كان هناك حساب تم إنشاؤه باستخدام هذا البريد الإلكتروني ، فستتلقى بريدًا إلكترونيًا به ارتباط لإعادة تعيين كلمة المرور الخاصة بك.",
"authentication.forgotPassword.passwordConfirmation": "تأكيد كلمة المرور",
"authentication.forgotPassword.sendEmail": "أدخل بريدك الإلكتروني للحصول على رابط إعادة تعيين كلمة المرور",
"authentication.forgotPassword.sendEmailButton": "ارسل بريد الكتروني",
"authentication.forgotPassword.sendEmailNotes": "يرجى إدخال بريدك الإلكتروني لنرسل لك رابط إعادة تعيين كلمة المرور. إذا لم تستلم بريدًا إلكترونيًا، فقد لا يكون لديك حساب.",
Expand Down Expand Up @@ -741,7 +736,6 @@
"errors.notFound.subtitle": "عذرا، لم نتمكن من العثور على الصفحة التي تبحث عنها.",
"errors.notFound.title": "لم يتم العثور على الصفحة",
"errors.numberError": "الرجاء إدخال رقم صالح أكبر من 0.",
"errors.passwordConfirmationMismatch": "تأكيد كلمة المرور غير متطابق",
"errors.phoneNumberError": "الرجاء إدخال رقم هاتف",
"errors.phoneNumberTypeError": "الرجاء إدخال نوع رقم الهاتف",
"errors.rateLimitExceeded": "تم تجاوز حد المعدل ، حاول مرة أخرى لاحقًا.",
Expand Down
6 changes: 0 additions & 6 deletions shared-helpers/src/locales/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@
"account.settings.alerts.genericError": "একটি ত্রুটি হয়েছে। অনুগ্রহ করে আবার চেষ্টা করুন, অথবা সাহায্যের জন্য %{contactEmail} এ সহায়তার সাথে যোগাযোগ করুন।",
"account.settings.alerts.nameSuccess": "নাম আপডেট সফল",
"account.settings.alerts.passwordEmpty": "পাসওয়ার্ড ক্ষেত্রগুলি খালি নাও থাকতে পারে",
"account.settings.alerts.passwordMatch": "নতুন পাসওয়ার্ড ক্ষেত্র মিলছে না",
"account.settings.alerts.passwordSuccess": "পাসওয়ার্ড আপডেট সফল",
"account.settings.confirmNewPassword": "নিশ্চিত কর নতুন গোপননম্বর",
"account.settings.currentPassword": "বর্তমান পাসওয়ার্ড",
"account.settings.myNotification": "আমার বিজ্ঞপ্তিগুলি",
"account.settings.myProfile": "আমার প্রোফাইল",
Expand Down Expand Up @@ -593,15 +591,13 @@
"authentication.createAccount.errors.emailNotFound": "ইমেল পাওয়া যায়নি। দয়া করে প্রথমে নিবন্ধন করুন।",
"authentication.createAccount.errors.errorSaving": "ওহো! মনে হচ্ছে কিছু একটা সমস্যা হয়েছে। অনুগ্রহ করে আবার চেষ্টা করুন। \n\nযদি আপনার এখনও কোনও সমস্যা হয়, তাহলে আপনার আবাসন বিভাগের সাথে যোগাযোগ করুন।",
"authentication.createAccount.errors.generic": "আপনার অ্যাকাউন্ট তৈরি করার সময় কিছু সমস্যা হয়েছে। অনুগ্রহ করে আবার চেষ্টা করুন।\n\nযদি আপনার এখনও কোনও সমস্যা হয়, তাহলে আপনার আবাসন বিভাগের সাথে যোগাযোগ করুন।",
"authentication.createAccount.errors.passwordMismatch": "পাসওয়ার্ড মেলে না",
"authentication.createAccount.errors.passwordTooWeak": "পাসওয়ার্ড খুব দুর্বল। কমপক্ষে 8 টি অক্ষর এবং কমপক্ষে 1 টি অক্ষর এবং কমপক্ষে একটি সংখ্যা থাকতে হবে।",
"authentication.createAccount.errors.tokenExpired": "আপনার লিঙ্কের মেয়াদ শেষ হয়ে গেছে।",
"authentication.createAccount.linkExpired": "আপনার লিঙ্কের মেয়াদ শেষ হয়ে গেছে",
"authentication.createAccount.noAccount": "কোনো অ্যাকাউন্ট নেই?",
"authentication.createAccount.password": "পাসওয়ার্ড",
"authentication.createAccount.passwordInfo": "কমপক্ষে 8 টি অক্ষর এবং কমপক্ষে 1 টি অক্ষর এবং কমপক্ষে একটি সংখ্যা থাকতে হবে।",
"authentication.createAccount.reEnterEmail": "ই - মেইল ​​এর ঠিকানা পুনঃ - প্রবেশ করান",
"authentication.createAccount.reEnterPassword": "আপনার পাসওয়ার্ড পুনরায় লিখুন",
"authentication.createAccount.resendAnEmailTo": "একটি ইমেল পুনরায় পাঠান",
"authentication.createAccount.resendEmailInfo": "অ্যাকাউন্ট তৈরি সম্পূর্ণ করার জন্য অনুগ্রহ করে আমরা আপনাকে ২ hours ঘন্টার মধ্যে যে ইমেইলটি পাঠাবো সেই লিঙ্কে ক্লিক করুন।",
"authentication.createAccount.resendTheEmail": "ইমেলটি আবার পাঠান",
Expand All @@ -612,7 +608,6 @@
"authentication.forgotPassword.errors.tokenExpired": "পাসওয়ার্ড টোকেনের মেয়াদ শেষ হয়ে গেছে। অনুগ্রহ করে নতুনের জন্য অনুরোধ করুন।",
"authentication.forgotPassword.errors.tokenMissing": "টোকেন পাওয়া যায়নি। অনুগ্রহ করে নতুনের জন্য অনুরোধ করুন।",
"authentication.forgotPassword.message": "যদি সেই ইমেল দিয়ে একটি অ্যাকাউন্ট তৈরি করা হয়, তাহলে আপনি আপনার পাসওয়ার্ড রিসেট করার জন্য একটি লিঙ্ক সহ একটি ইমেল পাবেন।",
"authentication.forgotPassword.passwordConfirmation": "পাসওয়ার্ড নিশ্চিতকরণ",
"authentication.forgotPassword.sendEmail": "পাসওয়ার্ড রিসেট লিঙ্ক পেতে আপনার ইমেল ঠিকানা লিখুন",
"authentication.forgotPassword.sendEmailButton": "ইমেইল",
"authentication.forgotPassword.sendEmailNotes": "আপনার ইমেল ঠিকানাটি লিখুন যাতে আমরা আপনাকে একটি পাসওয়ার্ড রিসেট লিঙ্ক পাঠাতে পারি। যদি আপনি কোনও ইমেল না পান, তাহলে আপনার কোনও অ্যাকাউন্ট নাও থাকতে পারে।",
Expand Down Expand Up @@ -741,7 +736,6 @@
"errors.notFound.subtitle": "দুঃখিত, আপনি যে পৃষ্ঠাটি খুঁজছেন তা আমরা খুঁজে পাইনি।",
"errors.notFound.title": "পৃষ্ঠাটি খুঁজে পাওয়া যায়নি",
"errors.numberError": "দয়া করে 0 এর চেয়ে বড় একটি বৈধ সংখ্যা লিখুন।",
"errors.passwordConfirmationMismatch": "পাসওয়ার্ড নিশ্চিতকরণ মিলছে না",
"errors.phoneNumberError": "দয়া করে একটি ফোন নম্বর লিখুন",
"errors.phoneNumberTypeError": "দয়া করে একটি ফোন নম্বর টাইপ করুন",
"errors.rateLimitExceeded": "রেটের সীমা অতিক্রম করেছে, পরে আবার চেষ্টা করুন।",
Expand Down
Loading
Loading