fix(auth): transition users only when transition mode enabled
This commit is contained in:
parent
398338c8f8
commit
610fba2601
2 changed files with 9 additions and 5 deletions
|
@ -981,6 +981,7 @@ export class ContainerConfigLoader {
|
|||
container.get(TYPES.Auth_GenerateRecoveryCodes),
|
||||
container.get(TYPES.Auth_Logger),
|
||||
container.get(TYPES.Auth_SessionService),
|
||||
container.get(TYPES.Auth_TRANSITION_MODE_ENABLED),
|
||||
),
|
||||
)
|
||||
container
|
||||
|
|
|
@ -37,6 +37,7 @@ export class AuthController implements UserServerInterface {
|
|||
private doGenerateRecoveryCodes: GenerateRecoveryCodes,
|
||||
private logger: Logger,
|
||||
private sessionService: SessionServiceInterface,
|
||||
private transitionModeEnabled: boolean,
|
||||
) {}
|
||||
|
||||
async update(_params: UserUpdateRequestParams): Promise<HttpResponse<UserUpdateResponse>> {
|
||||
|
@ -227,11 +228,13 @@ export class AuthController implements UserServerInterface {
|
|||
if (userUuid !== null) {
|
||||
headers = new Map([['x-invalidate-cache', userUuid]])
|
||||
|
||||
await this.domainEventPublisher.publish(
|
||||
this.domainEventFactory.createTransitionRequestedEvent({
|
||||
userUuid,
|
||||
}),
|
||||
)
|
||||
if (this.transitionModeEnabled) {
|
||||
await this.domainEventPublisher.publish(
|
||||
this.domainEventFactory.createTransitionRequestedEvent({
|
||||
userUuid,
|
||||
}),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue