Skip to content

Commit 1b1f01e

Browse files
committed
fix: remove get profile data before update it
1 parent b3a7dad commit 1b1f01e

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

apps/client/src/app/integrations/sso.configuration.ts

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -139,26 +139,17 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
139139
? this.filesService.getPresignedUrlAndUploadFile(data.picture)
140140
: of('')
141141
).pipe(
142-
mergeMap((picture) =>
143-
this.ssoRestService
144-
.ssoControllerProfile()
145-
.pipe(map((profile) => ({ ...data, ...profile, picture })))
146-
),
147-
catchError(() => of(null)),
148-
mergeMap((profile) => {
149-
if (!profile) {
150-
return throwError(() => new Error('profile not set'));
151-
}
142+
mergeMap((picture) => {
152143
return this.ssoRestService.ssoControllerUpdateProfile({
153-
birthdate: profile.birthdate,
154-
firstname: profile.givenName,
155-
gender: profile.gender,
156-
lastname: profile.familyName,
157-
picture: profile.picture,
158-
password: profile.newPassword,
159-
confirmPassword: profile.confirmNewPassword,
160-
oldPassword: profile.oldPassword,
161-
timezone: profile.timezone,
144+
birthdate: data.birthdate,
145+
firstname: data.givenName,
146+
gender: data.gender,
147+
lastname: data.familyName,
148+
picture,
149+
password: data.newPassword,
150+
confirmPassword: data.confirmNewPassword,
151+
oldPassword: data.oldPassword,
152+
timezone: data.timezone,
162153
});
163154
}),
164155
mergeMap(() => this.ssoRestService.ssoControllerProfile()),

apps/server/INFRASTRUCTURE.MD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,14 +493,14 @@ Minio client for NestJS-mod (Wrapper for https://www.npmjs.com/package/nestjs-mi
493493

494494
| Key | Constraints | Value |
495495
| ------ | ----------- | ----- |
496-
|`events`|**optional**|[ ```{"eventName":"notifications.create","description":"Event that fires after a notification is created","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","html":"<a>Hello {{{firstname}}}</a>","externalTenantId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","operationName":"forget-password","recipientData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+999999999"},"subject":"Some subject of email","type":"phone","context":{"firstname":"Firstname"},"senderData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+888888888"},"text":"Hello {{{firstname}}}","recipientGroupId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","createdAt":"2025-04-30T13:09:22.272Z","updatedAt":"2025-04-30T13:09:22.272Z"}}```, ```{"eventName":"notifications.update","description":"Event that fires after a notification is updated","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","html":"<a>Hello {{{firstname}}}</a>","externalTenantId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","operationName":"forget-password","recipientData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+999999999"},"subject":"Some subject of email","type":"phone","context":{"firstname":"Firstname"},"senderData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+888888888"},"text":"Hello {{{firstname}}}","recipientGroupId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","createdAt":"2025-04-30T13:09:22.272Z","updatedAt":"2025-04-30T13:09:22.272Z"}}```, ```{"eventName":"notifications.sent","description":"Event that fires after a notification is sent","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","html":"<a>Hello {{{firstname}}}</a>","externalTenantId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","operationName":"forget-password","recipientData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+999999999"},"subject":"Some subject of email","type":"phone","context":{"firstname":"Firstname"},"senderData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+888888888"},"text":"Hello {{{firstname}}}","recipientGroupId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","createdAt":"2025-04-30T13:09:22.272Z","updatedAt":"2025-04-30T13:09:22.272Z"}}```, ```{"eventName":"notifications.error","description":"Event that occurs when there is an error sending a notification","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","html":"<a>Hello {{{firstname}}}</a>","externalTenantId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","operationName":"forget-password","recipientData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+999999999"},"subject":"Some subject of email","type":"phone","context":{"firstname":"Firstname"},"senderData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+888888888"},"text":"Hello {{{firstname}}}","recipientGroupId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","attempt":2,"error":"Error object","used":false,"createdAt":"2025-04-30T13:09:22.272Z","updatedAt":"2025-04-30T13:09:22.272Z"}}``` ]|
496+
|`events`|**optional**|[ ```{"eventName":"notifications.create","description":"Event that fires after a notification is created","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","html":"<a>Hello {{{firstname}}}</a>","externalTenantId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","operationName":"forget-password","recipientData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+999999999"},"subject":"Some subject of email","type":"phone","context":{"firstname":"Firstname"},"senderData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+888888888"},"text":"Hello {{{firstname}}}","recipientGroupId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","createdAt":"2025-05-01T06:27:26.137Z","updatedAt":"2025-05-01T06:27:26.137Z"}}```, ```{"eventName":"notifications.update","description":"Event that fires after a notification is updated","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","html":"<a>Hello {{{firstname}}}</a>","externalTenantId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","operationName":"forget-password","recipientData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+999999999"},"subject":"Some subject of email","type":"phone","context":{"firstname":"Firstname"},"senderData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+888888888"},"text":"Hello {{{firstname}}}","recipientGroupId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","createdAt":"2025-05-01T06:27:26.137Z","updatedAt":"2025-05-01T06:27:26.137Z"}}```, ```{"eventName":"notifications.sent","description":"Event that fires after a notification is sent","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","html":"<a>Hello {{{firstname}}}</a>","externalTenantId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","operationName":"forget-password","recipientData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+999999999"},"subject":"Some subject of email","type":"phone","context":{"firstname":"Firstname"},"senderData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+888888888"},"text":"Hello {{{firstname}}}","recipientGroupId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","createdAt":"2025-05-01T06:27:26.137Z","updatedAt":"2025-05-01T06:27:26.137Z"}}```, ```{"eventName":"notifications.error","description":"Event that occurs when there is an error sending a notification","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","html":"<a>Hello {{{firstname}}}</a>","externalTenantId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","operationName":"forget-password","recipientData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+999999999"},"subject":"Some subject of email","type":"phone","context":{"firstname":"Firstname"},"senderData":{"externalUserId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","email":"[email protected]","name":"User Name","phone":"+888888888"},"text":"Hello {{{firstname}}}","recipientGroupId":"77af2745-d972-4e1f-994a-fae8ad71d7ab","attempt":2,"error":"Error object","used":false,"createdAt":"2025-05-01T06:27:26.137Z","updatedAt":"2025-05-01T06:27:26.137Z"}}``` ]|
497497

498498
#### Modules that use feature configuration
499499
##### Feature module name: sso
500500

501501
| Key | Constraints | Value |
502502
| ------ | ----------- | ----- |
503-
|`events`|**optional**|[ ```{"eventName":"sso.sign-up","description":"An event that is triggered after a new user registers","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-04-30T13:09:22.758Z","createdAt":"2025-04-30T13:09:22.758Z","email":"[email protected]","emailVerifiedAt":"2025-04-30T13:09:22.758Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-04-30T13:09:22.758Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-04-30T13:09:22.758Z","roles":"user","updatedAt":"2025-04-30T13:09:22.758Z","username":"nickname","lang":"en","timezone":0}}```, ```{"eventName":"sso.sign-in","description":"An event that is triggered after a user login","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-04-30T13:09:22.758Z","createdAt":"2025-04-30T13:09:22.758Z","email":"[email protected]","emailVerifiedAt":"2025-04-30T13:09:22.758Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-04-30T13:09:22.758Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-04-30T13:09:22.758Z","roles":"user","updatedAt":"2025-04-30T13:09:22.758Z","username":"nickname","lang":"en","timezone":0}}```, ```{"eventName":"sso.complete-sign-up","description":"An event that is triggered after complete a new user registers","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-04-30T13:09:22.758Z","createdAt":"2025-04-30T13:09:22.758Z","email":"[email protected]","emailVerifiedAt":"2025-04-30T13:09:22.758Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-04-30T13:09:22.758Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-04-30T13:09:22.758Z","roles":"user","updatedAt":"2025-04-30T13:09:22.758Z","username":"nickname","lang":"en","timezone":0}}```, ```{"eventName":"sso.sign-out","description":"An event that is triggered after a user logout","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-04-30T13:09:22.758Z","createdAt":"2025-04-30T13:09:22.758Z","email":"[email protected]","emailVerifiedAt":"2025-04-30T13:09:22.758Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-04-30T13:09:22.758Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-04-30T13:09:22.758Z","roles":"user","updatedAt":"2025-04-30T13:09:22.758Z","username":"nickname","lang":"en","timezone":0}}```, ```{"eventName":"sso.forgot-password","description":"An event that is triggered after a user call forgot password method","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-04-30T13:09:22.758Z","createdAt":"2025-04-30T13:09:22.758Z","email":"[email protected]","emailVerifiedAt":"2025-04-30T13:09:22.758Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-04-30T13:09:22.758Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-04-30T13:09:22.758Z","roles":"user","updatedAt":"2025-04-30T13:09:22.758Z","username":"nickname","lang":"en","timezone":0}}```, ```{"eventName":"sso.complete-forgot-password","description":"An event that is triggered after a user calls to confirm a forgotten password change","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-04-30T13:09:22.758Z","createdAt":"2025-04-30T13:09:22.758Z","email":"[email protected]","emailVerifiedAt":"2025-04-30T13:09:22.758Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-04-30T13:09:22.758Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-04-30T13:09:22.758Z","roles":"user","updatedAt":"2025-04-30T13:09:22.758Z","username":"nickname","lang":"en","timezone":0}}```, ```{"eventName":"sso.update-profile","description":"An event that fires after user information is updated.","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-04-30T13:09:22.758Z","createdAt":"2025-04-30T13:09:22.758Z","email":"[email protected]","emailVerifiedAt":"2025-04-30T13:09:22.758Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-04-30T13:09:22.758Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-04-30T13:09:22.758Z","roles":"user","updatedAt":"2025-04-30T13:09:22.758Z","username":"nickname","lang":"en","timezone":0}}``` ]|
503+
|`events`|**optional**|[ ```{"eventName":"sso.sign-up","description":"An event that is triggered after a new user registers","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-05-01T06:27:26.579Z","createdAt":"2025-05-01T06:27:26.579Z","email":"[email protected]","emailVerifiedAt":"2025-05-01T06:27:26.579Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-05-01T06:27:26.579Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-05-01T06:27:26.579Z","roles":"user","updatedAt":"2025-05-01T06:27:26.579Z","username":"nickname","lang":"en","timezone":0}}```, ```{"eventName":"sso.sign-in","description":"An event that is triggered after a user login","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-05-01T06:27:26.579Z","createdAt":"2025-05-01T06:27:26.579Z","email":"[email protected]","emailVerifiedAt":"2025-05-01T06:27:26.579Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-05-01T06:27:26.579Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-05-01T06:27:26.579Z","roles":"user","updatedAt":"2025-05-01T06:27:26.579Z","username":"nickname","lang":"en","timezone":0}}```, ```{"eventName":"sso.complete-sign-up","description":"An event that is triggered after complete a new user registers","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-05-01T06:27:26.579Z","createdAt":"2025-05-01T06:27:26.579Z","email":"[email protected]","emailVerifiedAt":"2025-05-01T06:27:26.579Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-05-01T06:27:26.579Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-05-01T06:27:26.579Z","roles":"user","updatedAt":"2025-05-01T06:27:26.579Z","username":"nickname","lang":"en","timezone":0}}```, ```{"eventName":"sso.sign-out","description":"An event that is triggered after a user logout","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-05-01T06:27:26.579Z","createdAt":"2025-05-01T06:27:26.579Z","email":"[email protected]","emailVerifiedAt":"2025-05-01T06:27:26.579Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-05-01T06:27:26.579Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-05-01T06:27:26.579Z","roles":"user","updatedAt":"2025-05-01T06:27:26.579Z","username":"nickname","lang":"en","timezone":0}}```, ```{"eventName":"sso.forgot-password","description":"An event that is triggered after a user call forgot password method","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-05-01T06:27:26.579Z","createdAt":"2025-05-01T06:27:26.579Z","email":"[email protected]","emailVerifiedAt":"2025-05-01T06:27:26.579Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-05-01T06:27:26.579Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-05-01T06:27:26.579Z","roles":"user","updatedAt":"2025-05-01T06:27:26.579Z","username":"nickname","lang":"en","timezone":0}}```, ```{"eventName":"sso.complete-forgot-password","description":"An event that is triggered after a user calls to confirm a forgotten password change","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-05-01T06:27:26.579Z","createdAt":"2025-05-01T06:27:26.579Z","email":"[email protected]","emailVerifiedAt":"2025-05-01T06:27:26.579Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-05-01T06:27:26.579Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-05-01T06:27:26.579Z","roles":"user","updatedAt":"2025-05-01T06:27:26.579Z","username":"nickname","lang":"en","timezone":0}}```, ```{"eventName":"sso.update-profile","description":"An event that fires after user information is updated.","example":{"id":"77af2745-d972-4e1f-994a-fae8ad71d7ab","appData":{"custom":"data"},"birthdate":"2025-05-01T06:27:26.579Z","createdAt":"2025-05-01T06:27:26.579Z","email":"[email protected]","emailVerifiedAt":"2025-05-01T06:27:26.579Z","firstname":"Firstname","gender":"m","lastname":"Lastname","phone":"+888888888","phoneVerifiedAt":"2025-05-01T06:27:26.579Z","picture":"http://example.com/image/77af2745-d972-4e1f-994a-fae8ad71d7ab.jpg","revokedAt":"2025-05-01T06:27:26.579Z","roles":"user","updatedAt":"2025-05-01T06:27:26.579Z","username":"nickname","lang":"en","timezone":0}}``` ]|
504504

505505
### SsoModule
506506
#### Shared providers

0 commit comments

Comments
 (0)