Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShishkevich D. <135337715+shishkevichd@users.noreply.github.com>2025-05-08 17:20:58 +0300
committerGitHub <noreply@github.com>2025-05-08 17:20:58 +0300
commitfe3b1c9b52f584b0f045907585b206344fed55db (patch)
treeaeef0fa82a0355ee899ec3aecee23045a327a6dc /main.go
parentd39ccf4b8f77f99d4468580085e9d89e8b5f0b1c (diff)
chore: implement 2fa auth (#2968)
* chore: implement 2fa auth from #2786 * chore: format code * chore: replace two factor token input with qr-code * chore: requesting confirmation of setting/removing two-factor authentication otpauth library was taken from cdnjs * chore: revert changes in `ClipboardManager` don't need it. * chore: removing twoFactor prop in settings page * chore: remove `twoFactorQr` object in `mounted` function
Diffstat (limited to 'main.go')
-rw-r--r--main.go35
1 files changed, 0 insertions, 35 deletions
diff --git a/main.go b/main.go
index ed30a11f..a94a899b 100644
--- a/main.go
+++ b/main.go
@@ -346,36 +346,6 @@ func migrateDb() {
fmt.Println("Migration done!")
}
-func removeSecret() {
- userService := service.UserService{}
-
- secretExists, err := userService.CheckSecretExistence()
- if err != nil {
- fmt.Println("Error checking secret existence:", err)
- return
- }
-
- if !secretExists {
- fmt.Println("No secret exists to remove.")
- return
- }
-
- err = userService.RemoveUserSecret()
- if err != nil {
- fmt.Println("Error removing secret:", err)
- return
- }
-
- settingService := service.SettingService{}
- err = settingService.SetSecretStatus(false)
- if err != nil {
- fmt.Println("Error updating secret status:", err)
- return
- }
-
- fmt.Println("Secret removed successfully.")
-}
-
func main() {
if len(os.Args) < 2 {
runWebServer()
@@ -403,10 +373,8 @@ func main() {
var reset bool
var show bool
var getCert bool
- var remove_secret bool
settingCmd.BoolVar(&reset, "reset", false, "Reset all settings")
settingCmd.BoolVar(&show, "show", false, "Display current settings")
- settingCmd.BoolVar(&remove_secret, "remove_secret", false, "Remove secret key")
settingCmd.IntVar(&port, "port", 0, "Set panel port number")
settingCmd.StringVar(&username, "username", "", "Set login username")
settingCmd.StringVar(&password, "password", "", "Set login password")
@@ -470,9 +438,6 @@ func main() {
if (tgbottoken != "") || (tgbotchatid != "") || (tgbotRuntime != "") {
updateTgbotSetting(tgbottoken, tgbotchatid, tgbotRuntime)
}
- if remove_secret {
- removeSecret()
- }
if enabletgbot {
updateTgbotEnableSts(enabletgbot)
}