diff --git a/cmd/gosky/admin.go b/cmd/gosky/admin.go index 8134897dc..a954b20cc 100644 --- a/cmd/gosky/admin.go +++ b/cmd/gosky/admin.go @@ -103,7 +103,8 @@ var checkUserCmd = &cli.Command{ } else { handle, _, err := api.ResolveDidToHandle(ctx, xrpcc, plcc, phr, fa) if err != nil { - return fmt.Errorf("resolve did %q: %w", fa, err) + fmt.Println("ERROR: failed to resolve inviter: ", err) + handle = fa } invby = handle diff --git a/cmd/gosky/main.go b/cmd/gosky/main.go index aaec50938..528440db1 100644 --- a/cmd/gosky/main.go +++ b/cmd/gosky/main.go @@ -94,7 +94,6 @@ func run(args []string) { refreshAuthTokenCmd, syncCmd, listAllPostsCmd, - deletePostCmd, getNotificationsCmd, followsCmd, resetPasswordCmd, @@ -105,6 +104,8 @@ func run(args []string) { adminCmd, createFeedGeneratorCmd, rebaseRepoCmd, + requestAccountDeletionCmd, + deleteAccountCmd, } app.RunAndExitOnError() @@ -1566,3 +1567,44 @@ var rebaseRepoCmd = &cli.Command{ return nil }, } + +var requestAccountDeletionCmd = &cli.Command{ + Name: "request-account-deletion", + Action: func(cctx *cli.Context) error { + xrpcc, err := cliutil.GetXrpcClient(cctx, false) + if err != nil { + return err + } + + err = comatproto.ServerRequestAccountDelete(cctx.Context, xrpcc) + if err != nil { + return err + } + + return nil + }, +} + +var deleteAccountCmd = &cli.Command{ + Name: "delete-account", + Action: func(cctx *cli.Context) error { + xrpcc, err := cliutil.GetXrpcClient(cctx, false) + if err != nil { + return err + } + + token := cctx.Args().First() + password := cctx.Args().Get(1) + + err = comatproto.ServerDeleteAccount(cctx.Context, xrpcc, &comatproto.ServerDeleteAccount_Input{ + Did: xrpcc.Auth.Did, + Token: token, + Password: password, + }) + if err != nil { + return err + } + + return nil + }, +}