@axway/axway-cli-oum
Version:
Axway Amplify platform organization and user management CLI
26 lines (21 loc) • 725 B
JavaScript
import { initSDK, isHeadless } from '@axway/amplify-cli-utils';
import snooplogg from 'snooplogg';
import pkg from 'open';
var credentials = {
desc: 'Opens a web browser to the change your password page',
async action({ console }) {
const { highlight } = snooplogg.styles;
const { sdk } = await initSDK();
const open = pkg;
if (isHeadless()) {
throw new Error('Changing your login credentials requires a web browser and is unsupported in headless environments');
}
if (sdk !== null) {
const url = `${sdk.platformUrl}/user/credentials`;
console.log(`Opening web browser to ${highlight(url)}`);
await open(url);
}
}
};
export { credentials as default };
//# sourceMappingURL=credentials.js.map