UI: Fix Credentials parsing to use simplified credentials object

This commit is contained in:
Ilija Lazoroski 2022-07-18 21:49:24 +02:00
parent 57f2c7e058
commit b3ec9e340f
1 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ export function getAllUsernames(stolen, configured){
export function getCredentialsUsernames(credentials) { export function getCredentialsUsernames(credentials) {
let usernames = []; let usernames = [];
for(let i = 0; i < credentials.length; i++){ for(let i = 0; i < credentials.length; i++){
usernames.push(credentials[i]['identities'][0]['username']); usernames.push(credentials[i]['identity']['username']);
} }
return usernames; return usernames;
} }
@ -16,10 +16,10 @@ export function getCredentialsUsernames(credentials) {
export function getAllSecrets(stolen, configured){ export function getAllSecrets(stolen, configured){
let secrets = []; let secrets = [];
for(let i = 0; i < stolen.length; i++){ for(let i = 0; i < stolen.length; i++){
secrets.push(getSecretsFromCredential(stolen[i]['secrets'][0])); secrets.push(getSecretsFromCredential(stolen[i]['secret']));
} }
for(let i = 0; i < configured.length; i++){ for(let i = 0; i < configured.length; i++){
secrets.push(getSecretsFromCredential(configured[i]['secrets'][0])); secrets.push(getSecretsFromCredential(configured[i]['secret']));
} }
return secrets; return secrets;
} }