refactor: Remove all references to the resetPasswordToken field (no-changelog) (#6751)

refactor: remove all references to the resetPasswordToken field (no-changelog)
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-07-27 11:53:25 +02:00 committed by GitHub
parent feac369f6c
commit e6903a87b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 77 deletions

View file

@ -11,7 +11,6 @@ const defaultUserProps = {
lastName: null, lastName: null,
email: null, email: null,
password: null, password: null,
resetPasswordToken: null,
}; };
export class Reset extends BaseCommand { export class Reset extends BaseCommand {

View file

@ -47,17 +47,8 @@ describe('POST /login', () => {
expect(response.statusCode).toBe(200); expect(response.statusCode).toBe(200);
const { const { id, email, firstName, lastName, password, personalizationAnswers, globalRole, apiKey } =
id, response.body.data;
email,
firstName,
lastName,
password,
personalizationAnswers,
globalRole,
resetPasswordToken,
apiKey,
} = response.body.data;
expect(validator.isUUID(id)).toBe(true); expect(validator.isUUID(id)).toBe(true);
expect(email).toBe(owner.email); expect(email).toBe(owner.email);
@ -66,7 +57,6 @@ describe('POST /login', () => {
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(personalizationAnswers).toBeNull(); expect(personalizationAnswers).toBeNull();
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(resetPasswordToken).toBeUndefined();
expect(globalRole).toBeDefined(); expect(globalRole).toBeDefined();
expect(globalRole.name).toBe('owner'); expect(globalRole.name).toBe('owner');
expect(globalRole.scope).toBe('global'); expect(globalRole.scope).toBe('global');
@ -137,17 +127,8 @@ describe('GET /login', () => {
expect(response.statusCode).toBe(200); expect(response.statusCode).toBe(200);
const { const { id, email, firstName, lastName, password, personalizationAnswers, globalRole, apiKey } =
id, response.body.data;
email,
firstName,
lastName,
password,
personalizationAnswers,
globalRole,
resetPasswordToken,
apiKey,
} = response.body.data;
expect(validator.isUUID(id)).toBe(true); expect(validator.isUUID(id)).toBe(true);
expect(email).toBeDefined(); expect(email).toBeDefined();
@ -156,7 +137,6 @@ describe('GET /login', () => {
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(personalizationAnswers).toBeNull(); expect(personalizationAnswers).toBeNull();
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(resetPasswordToken).toBeUndefined();
expect(globalRole).toBeDefined(); expect(globalRole).toBeDefined();
expect(globalRole.name).toBe('owner'); expect(globalRole.name).toBe('owner');
expect(globalRole.scope).toBe('global'); expect(globalRole.scope).toBe('global');
@ -173,17 +153,8 @@ describe('GET /login', () => {
expect(response.statusCode).toBe(200); expect(response.statusCode).toBe(200);
const { const { id, email, firstName, lastName, password, personalizationAnswers, globalRole, apiKey } =
id, response.body.data;
email,
firstName,
lastName,
password,
personalizationAnswers,
globalRole,
resetPasswordToken,
apiKey,
} = response.body.data;
expect(validator.isUUID(id)).toBe(true); expect(validator.isUUID(id)).toBe(true);
expect(email).toBeDefined(); expect(email).toBeDefined();
@ -192,7 +163,6 @@ describe('GET /login', () => {
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(personalizationAnswers).toBeNull(); expect(personalizationAnswers).toBeNull();
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(resetPasswordToken).toBeUndefined();
expect(globalRole).toBeDefined(); expect(globalRole).toBeDefined();
expect(globalRole.name).toBe('member'); expect(globalRole.name).toBe('member');
expect(globalRole.scope).toBe('global'); expect(globalRole.scope).toBe('global');
@ -209,17 +179,8 @@ describe('GET /login', () => {
expect(response.statusCode).toBe(200); expect(response.statusCode).toBe(200);
const { const { id, email, firstName, lastName, password, personalizationAnswers, globalRole, apiKey } =
id, response.body.data;
email,
firstName,
lastName,
password,
personalizationAnswers,
globalRole,
resetPasswordToken,
apiKey,
} = response.body.data;
expect(validator.isUUID(id)).toBe(true); expect(validator.isUUID(id)).toBe(true);
expect(email).toBe(owner.email); expect(email).toBe(owner.email);
@ -228,7 +189,6 @@ describe('GET /login', () => {
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(personalizationAnswers).toBeNull(); expect(personalizationAnswers).toBeNull();
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(resetPasswordToken).toBeUndefined();
expect(globalRole).toBeDefined(); expect(globalRole).toBeDefined();
expect(globalRole.name).toBe('owner'); expect(globalRole.name).toBe('owner');
expect(globalRole.scope).toBe('global'); expect(globalRole.scope).toBe('global');
@ -245,17 +205,8 @@ describe('GET /login', () => {
expect(response.statusCode).toBe(200); expect(response.statusCode).toBe(200);
const { const { id, email, firstName, lastName, password, personalizationAnswers, globalRole, apiKey } =
id, response.body.data;
email,
firstName,
lastName,
password,
personalizationAnswers,
globalRole,
resetPasswordToken,
apiKey,
} = response.body.data;
expect(validator.isUUID(id)).toBe(true); expect(validator.isUUID(id)).toBe(true);
expect(email).toBe(member.email); expect(email).toBe(member.email);
@ -264,7 +215,6 @@ describe('GET /login', () => {
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(personalizationAnswers).toBeNull(); expect(personalizationAnswers).toBeNull();
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(resetPasswordToken).toBeUndefined();
expect(globalRole).toBeDefined(); expect(globalRole).toBeDefined();
expect(globalRole.name).toBe('member'); expect(globalRole.name).toBe('member');
expect(globalRole.scope).toBe('global'); expect(globalRole.scope).toBe('global');

View file

@ -42,7 +42,5 @@ test.skip('user-management:reset should reset DB to default user state', async (
expect(user.firstName).toBeNull(); expect(user.firstName).toBeNull();
expect(user.lastName).toBeNull(); expect(user.lastName).toBeNull();
expect(user.password).toBeNull(); expect(user.password).toBeNull();
expect(user.resetPasswordToken).toBeNull();
expect(user.resetPasswordTokenExpiration).toBeNull();
expect(user.personalizationAnswers).toBeNull(); expect(user.personalizationAnswers).toBeNull();
}); });

View file

@ -53,7 +53,6 @@ describe('Owner shell', () => {
personalizationAnswers, personalizationAnswers,
globalRole, globalRole,
password, password,
resetPasswordToken,
isPending, isPending,
apiKey, apiKey,
} = response.body.data; } = response.body.data;
@ -64,7 +63,6 @@ describe('Owner shell', () => {
expect(lastName).toBe(validPayload.lastName); expect(lastName).toBe(validPayload.lastName);
expect(personalizationAnswers).toBeNull(); expect(personalizationAnswers).toBeNull();
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(resetPasswordToken).toBeUndefined();
expect(isPending).toBe(false); expect(isPending).toBe(false);
expect(globalRole.name).toBe('owner'); expect(globalRole.name).toBe('owner');
expect(globalRole.scope).toBe('global'); expect(globalRole.scope).toBe('global');
@ -198,7 +196,6 @@ describe('Member', () => {
personalizationAnswers, personalizationAnswers,
globalRole, globalRole,
password, password,
resetPasswordToken,
isPending, isPending,
apiKey, apiKey,
} = response.body.data; } = response.body.data;
@ -209,7 +206,6 @@ describe('Member', () => {
expect(lastName).toBe(validPayload.lastName); expect(lastName).toBe(validPayload.lastName);
expect(personalizationAnswers).toBeNull(); expect(personalizationAnswers).toBeNull();
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(resetPasswordToken).toBeUndefined();
expect(isPending).toBe(false); expect(isPending).toBe(false);
expect(globalRole.name).toBe('member'); expect(globalRole.name).toBe('member');
expect(globalRole.scope).toBe('global'); expect(globalRole.scope).toBe('global');
@ -334,7 +330,6 @@ describe('Owner', () => {
personalizationAnswers, personalizationAnswers,
globalRole, globalRole,
password, password,
resetPasswordToken,
isPending, isPending,
apiKey, apiKey,
} = response.body.data; } = response.body.data;
@ -345,7 +340,6 @@ describe('Owner', () => {
expect(lastName).toBe(validPayload.lastName); expect(lastName).toBe(validPayload.lastName);
expect(personalizationAnswers).toBeNull(); expect(personalizationAnswers).toBeNull();
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(resetPasswordToken).toBeUndefined();
expect(isPending).toBe(false); expect(isPending).toBe(false);
expect(globalRole.name).toBe('owner'); expect(globalRole.name).toBe('owner');
expect(globalRole.scope).toBe('global'); expect(globalRole.scope).toBe('global');

View file

@ -55,7 +55,6 @@ describe('POST /owner/setup', () => {
personalizationAnswers, personalizationAnswers,
globalRole, globalRole,
password, password,
resetPasswordToken,
isPending, isPending,
apiKey, apiKey,
} = response.body.data; } = response.body.data;
@ -67,7 +66,6 @@ describe('POST /owner/setup', () => {
expect(personalizationAnswers).toBeNull(); expect(personalizationAnswers).toBeNull();
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(isPending).toBe(false); expect(isPending).toBe(false);
expect(resetPasswordToken).toBeUndefined();
expect(globalRole.name).toBe('owner'); expect(globalRole.name).toBe('owner');
expect(globalRole.scope).toBe('global'); expect(globalRole.scope).toBe('global');
expect(apiKey).toBeUndefined(); expect(apiKey).toBeUndefined();

View file

@ -73,7 +73,6 @@ describe('With license unlimited quota:users', () => {
personalizationAnswers, personalizationAnswers,
globalRole, globalRole,
password, password,
resetPasswordToken,
isPending, isPending,
createdAt, createdAt,
updatedAt, updatedAt,
@ -85,7 +84,6 @@ describe('With license unlimited quota:users', () => {
expect(lastName).toBeDefined(); expect(lastName).toBeDefined();
expect(personalizationAnswers).toBeUndefined(); expect(personalizationAnswers).toBeUndefined();
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(resetPasswordToken).toBeUndefined();
expect(isPending).toBe(false); expect(isPending).toBe(false);
expect(globalRole).toBeUndefined(); expect(globalRole).toBeUndefined();
expect(createdAt).toBeDefined(); expect(createdAt).toBeDefined();
@ -144,7 +142,6 @@ describe('With license unlimited quota:users', () => {
personalizationAnswers, personalizationAnswers,
globalRole, globalRole,
password, password,
resetPasswordToken,
isPending, isPending,
createdAt, createdAt,
updatedAt, updatedAt,
@ -156,7 +153,6 @@ describe('With license unlimited quota:users', () => {
expect(lastName).toBeDefined(); expect(lastName).toBeDefined();
expect(personalizationAnswers).toBeUndefined(); expect(personalizationAnswers).toBeUndefined();
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(resetPasswordToken).toBeUndefined();
expect(globalRole).toBeUndefined(); expect(globalRole).toBeUndefined();
expect(createdAt).toBeDefined(); expect(createdAt).toBeDefined();
expect(isPending).toBeDefined(); expect(isPending).toBeDefined();
@ -192,7 +188,6 @@ describe('With license unlimited quota:users', () => {
personalizationAnswers, personalizationAnswers,
globalRole, globalRole,
password, password,
resetPasswordToken,
isPending, isPending,
createdAt, createdAt,
updatedAt, updatedAt,
@ -204,7 +199,6 @@ describe('With license unlimited quota:users', () => {
expect(lastName).toBeDefined(); expect(lastName).toBeDefined();
expect(personalizationAnswers).toBeUndefined(); expect(personalizationAnswers).toBeUndefined();
expect(password).toBeUndefined(); expect(password).toBeUndefined();
expect(resetPasswordToken).toBeUndefined();
expect(isPending).toBe(false); expect(isPending).toBe(false);
expect(globalRole).toBeUndefined(); expect(globalRole).toBeUndefined();
expect(createdAt).toBeDefined(); expect(createdAt).toBeDefined();