Fix association of 'me' principal to OIDC provider

- When enabling oidc the principal tagged with me should be added to the providers `allowedPrincipalIds` collection
- This wasn't happenening due to a code change (`me` --> `principal`)
This commit is contained in:
Richard Cox 2021-06-02 11:27:11 +01:00
parent 1f0e95beff
commit 488c7aeada
1 changed files with 4 additions and 4 deletions

View File

@ -160,12 +160,12 @@ export default {
this.model.allowedPrincipalIds = this.model.allowedPrincipalIds || [];
if ( this.me) {
if (!this.model.allowedPrincipalIds.includes(this.me.id) ) {
addObject(this.model.allowedPrincipalIds, this.me.id);
if ( this.principal) {
if (!this.model.allowedPrincipalIds.includes(this.principal.id) ) {
addObject(this.model.allowedPrincipalIds, this.principal.id);
}
// Session has switched to new 'me', ensure we react
this.$store.commit('auth/loggedInAs', this.me.id);
this.$store.commit('auth/loggedInAs', this.principal.id);
} else {
console.warn(`Unable to find principal marked as 'me'`); // eslint-disable-line no-console
}