/*1Copyright © 2022 NAME HERE <EMAIL ADDRESS>2*/3package cmd45import (6"github.com/alist-org/alist/v3/internal/op"7"github.com/alist-org/alist/v3/pkg/utils"8"github.com/spf13/cobra"9)1011// Cancel2FACmd represents the delete2fa command12var Cancel2FACmd = &cobra.Command{13Use: "cancel2fa",14Short: "Delete 2FA of admin user",15Run: func(cmd *cobra.Command, args []string) {16Init()17defer Release()18admin, err := op.GetAdmin()19if err != nil {20utils.Log.Errorf("failed to get admin user: %+v", err)21} else {22err := op.Cancel2FAByUser(admin)23if err != nil {24utils.Log.Errorf("failed to cancel 2FA: %+v", err)25} else {26utils.Log.Info("2FA canceled")27DelAdminCacheOnline()28}29}30},31}3233func init() {34RootCmd.AddCommand(Cancel2FACmd)3536// Here you will define your flags and configuration settings.3738// Cobra supports Persistent Flags which will work for this command39// and all subcommands, e.g.:40// cancel2FACmd.PersistentFlags().String("foo", "", "A help for foo")4142// Cobra supports local flags which will only run when this command43// is called directly, e.g.:44// cancel2FACmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")45}464748