Skip to content

Commit

Permalink
chore: Release v1.3.8 - See CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun-KumarH committed Oct 21, 2023
1 parent 6587f59 commit fc6c7da
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.8 (October 21st, 2023)

- delete tokens from redis on user deletion

## 1.3.7 (October 14th, 2023)

- added null condition for comparison of nested attributes
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@restorecommerce/identity-srv",
"version": "1.3.7",
"version": "1.3.8",
"description": "Restorecommerce identity service",
"main": "lib/start.js",
"author": "n-fuse GmbH",
Expand Down
24 changes: 23 additions & 1 deletion src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1896,7 +1896,7 @@ export class UserService extends ServiceBase<UserListResponse, UserList> impleme
}

private nestedAttributesEqual(dbAttributes, userAttributes) {
if(!userAttributes) {
if (!userAttributes) {
return true;
}
if (dbAttributes?.length > 0 && userAttributes?.length > 0) {
Expand Down Expand Up @@ -2245,6 +2245,28 @@ export class UserService extends ServiceBase<UserListResponse, UserList> impleme
ids: userIDs
}), context);
logger.info('Users deleted:', userIDs);
if (userIDs.length > 0) {
const filters = [{
filters: [{
field: 'id',
operation: Filter_Operation.in,
value: JSON.stringify(userIDs),
type: FilterValueType.ARRAY
}]
}];
let userData = await super.read({
filters,
} as any, {});
if (userData?.items?.length > 0) {
userData?.items?.forEach((user) => {
user?.payload?.tokens?.forEach(async (tokenObj) => {
if(tokenObj?.token) {
await this.tokenRedisClient.del(tokenObj.token);
}
});
});
}
}
return deleteStatusArr;
}
}
Expand Down

0 comments on commit fc6c7da

Please sign in to comment.