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 /web/controller/setting.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 'web/controller/setting.go')
-rw-r--r--web/controller/setting.go29
1 files changed, 0 insertions, 29 deletions
diff --git a/web/controller/setting.go b/web/controller/setting.go
index 1ca65b07..dd99e0f5 100644
--- a/web/controller/setting.go
+++ b/web/controller/setting.go
@@ -19,10 +19,6 @@ type updateUserForm struct {
NewPassword string `json:"newPassword" form:"newPassword"`
}
-type updateSecretForm struct {
- LoginSecret string `json:"loginSecret" form:"loginSecret"`
-}
-
type SettingController struct {
settingService service.SettingService
userService service.UserService
@@ -44,8 +40,6 @@ func (a *SettingController) initRouter(g *gin.RouterGroup) {
g.POST("/updateUser", a.updateUser)
g.POST("/restartPanel", a.restartPanel)
g.GET("/getDefaultJsonConfig", a.getDefaultXrayConfig)
- g.POST("/updateUserSecret", a.updateSecret)
- g.POST("/getUserSecret", a.getUserSecret)
}
func (a *SettingController) getAllSetting(c *gin.Context) {
@@ -107,29 +101,6 @@ func (a *SettingController) restartPanel(c *gin.Context) {
jsonMsg(c, I18nWeb(c, "pages.settings.restartPanel"), err)
}
-func (a *SettingController) updateSecret(c *gin.Context) {
- form := &updateSecretForm{}
- err := c.ShouldBind(form)
- if err != nil {
- jsonMsg(c, I18nWeb(c, "pages.settings.toasts.modifySettings"), err)
- }
- user := session.GetLoginUser(c)
- err = a.userService.UpdateUserSecret(user.Id, form.LoginSecret)
- if err == nil {
- user.LoginSecret = form.LoginSecret
- session.SetLoginUser(c, user)
- }
- jsonMsg(c, I18nWeb(c, "pages.settings.toasts.modifyUser"), err)
-}
-
-func (a *SettingController) getUserSecret(c *gin.Context) {
- loginUser := session.GetLoginUser(c)
- user := a.userService.GetUserSecret(loginUser.Id)
- if user != nil {
- jsonObj(c, user, nil)
- }
-}
-
func (a *SettingController) getDefaultXrayConfig(c *gin.Context) {
defaultJsonConfig, err := a.settingService.GetDefaultXrayConfig()
if err != nil {