Make sure that the license page under settings has creds available

This commit is contained in:
mabashian 2019-09-10 14:26:52 -04:00 committed by Ryan Petrello
parent 113622c05e
commit 611f163289
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -53,4 +53,24 @@ export default {
}
});
}],
resolve: {
rhCreds: ['Rest', 'GetBasePath', function(Rest, GetBasePath) {
Rest.setUrl(`${GetBasePath('settings')}system/`);
return Rest.get()
.then(({data}) => {
const rhCreds = {};
if (data.REDHAT_USERNAME && data.REDHAT_USERNAME !== "") {
rhCreds.REDHAT_USERNAME = data.REDHAT_USERNAME;
}
if (data.REDHAT_PASSWORD && data.REDHAT_PASSWORD !== "") {
rhCreds.REDHAT_PASSWORD = data.REDHAT_PASSWORD;
}
return rhCreds;
}).catch(() => {
return {};
});
}]
}
};