diff options
| author | 2025-08-13 12:24:40 +0200 | |
|---|---|---|
| committer | 2025-08-13 12:24:40 +0200 | |
| commit | 7f8cb204cd5a58eb143ab20a21bfa32bd8c3c26b (patch) | |
| tree | e8a10032b73bd1c60df5c8e8fdf7817410d67e1a /cmd/gotosocial/admin.go | |
| parent | [chore] bump to code.superseriousbusiness.org/oauth2/v4@ssb-v4.5.3-2 (#4367) (diff) | |
| download | gotosocial-7f8cb204cd5a58eb143ab20a21bfa32bd8c3c26b.tar.xz | |
[feature] 2fa management via CLI (#4368)
Adds 2FA management to the admin CLI. Also does some CLI refactoring so the functions we pass around are exported functions instead of changeable global variables.
closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4320
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4368
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'cmd/gotosocial/admin.go')
| -rw-r--r-- | cmd/gotosocial/admin.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cmd/gotosocial/admin.go b/cmd/gotosocial/admin.go index 63c37a7ce..93fc9c1f8 100644 --- a/cmd/gotosocial/admin.go +++ b/cmd/gotosocial/admin.go @@ -146,6 +146,19 @@ func adminCommands() *cobra.Command { config.AddAdminAccountPassword(adminAccountPasswordCmd) adminAccountCmd.AddCommand(adminAccountPasswordCmd) + adminAccountDisable2FACmd := &cobra.Command{ + Use: "disable-2fa", + Short: "disable 2fa for the given local account", + PreRunE: func(cmd *cobra.Command, args []string) error { + return preRun(preRunArgs{cmd: cmd}) + }, + RunE: func(cmd *cobra.Command, args []string) error { + return run(cmd.Context(), account.Disable2FA) + }, + } + config.AddAdminAccount(adminAccountDisable2FACmd) + adminAccountCmd.AddCommand(adminAccountDisable2FACmd) + adminCmd.AddCommand(adminAccountCmd) /* |
