Skip to content

Commit

Permalink
Remove delete user CLI
Browse files Browse the repository at this point in the history
Attempting to delete a user was resulting in an "unauthorized user" error. According to a GitHub issue discussion for the WinHue project[1], the bridge API no longer allows deleting users, and it now must be done through the Hue webapp.

[1]: Hyrules/WinHue#231 (comment)
  • Loading branch information
doingweb committed Aug 18, 2019
1 parent 019855c commit cb04888
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/cli/manage-users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ export async function manageUsersCli(app: WatneyApp) {
{
name: 'View Details',
value: viewUserDetails
},
{
name: 'Delete User',
value: deleteUser
}
],
message: user.name,
Expand All @@ -69,20 +65,4 @@ export async function manageUsersCli(app: WatneyApp) {
async function viewUserDetails(user: IRegisteredUser) {
console.log(JSON.stringify(user, null, 2));
}

async function deleteUser(user: IRegisteredUser) {
const answers = await inquirer.prompt<{ confirmed: boolean }>({
message: `Are you sure you want to delete user "${user.name}" (${
user.username
})?`,
name: 'confirmed',
type: 'confirm'
});

if (!answers.confirmed) {
return;
}

await awaitableWrap(hue.api.deleteUser(user.username));
}
}

0 comments on commit cb04888

Please sign in to comment.