Skip to content

Commit

Permalink
CB-4097 fix: detect auth role correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud committed Nov 1, 2023
1 parent 2645f12 commit 16e6f48
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export class UserFormInfoPart extends FormPart<IUserFormInfoState, IUserFormStat
!isValuesEqual(this.state.enabled, this.initialState.enabled, null) ||
!isValuesEqual(this.state.password, this.initialState.password, null) ||
!isObjectsEqual(this.state.metaParameters, this.initialState.metaParameters) ||
!isArraysEqual(this.state.teams, this.initialState.teams)
!isArraysEqual(this.state.teams, this.initialState.teams) ||
!isValuesEqual(this.state.authRole, this.initialState.authRole, '')
);
}

Expand Down Expand Up @@ -204,12 +205,12 @@ export class UserFormInfoPart extends FormPart<IUserFormInfoState, IUserFormStat

this.setInitialState({
userId: user?.userId || this.formState.state.userId || '',
enabled: user?.enabled || DEFAULT_ENABLED,
enabled: user?.enabled ?? DEFAULT_ENABLED,
metaParameters: observable(user?.metaParameters || {}),
teams: observable(user?.grantedTeams || [serverConfig?.defaultUserTeam].filter(isDefined)),
password: '',

authRole: user?.authRole || serverConfig?.defaultAuthRole || '',
authRole: user?.authRole ?? serverConfig?.defaultAuthRole ?? '',
});
}
}
Expand Down

0 comments on commit 16e6f48

Please sign in to comment.