feature: Adds support for service accounts.
This commit is contained in:
parent
0e3335c4c2
commit
41013f46bb
2 changed files with 7 additions and 2 deletions
|
@ -43,6 +43,8 @@ export async function run(
|
|||
"Asks for a password. Hides output",
|
||||
);
|
||||
|
||||
addCommand.option("-s, --service-account, --service", "Turns the user into a service account");
|
||||
|
||||
addCommand.action(
|
||||
async (
|
||||
username: string,
|
||||
|
@ -51,6 +53,7 @@ export async function run(
|
|||
options: {
|
||||
password?: string;
|
||||
askPassword?: boolean;
|
||||
isServiceAccount?: boolean;
|
||||
},
|
||||
) => {
|
||||
if (!options.password && !options.askPassword) {
|
||||
|
@ -89,6 +92,8 @@ export async function run(
|
|||
username,
|
||||
email,
|
||||
password,
|
||||
|
||||
allowUnsafeGlobalTokens: options.isServiceAccount
|
||||
});
|
||||
|
||||
if (response.status != 200) {
|
||||
|
@ -103,7 +108,7 @@ export async function run(
|
|||
return;
|
||||
}
|
||||
|
||||
println("User created successfully.\n");
|
||||
println("User created successfully.\nToken: %s\n", response.data.token);
|
||||
},
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue