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
path: root/web
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2026-03-18 00:30:05 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2026-03-18 01:01:15 +0300
commitf0f98c712225269e1a3db1796eff88ebecaf2a2a (patch)
tree9894ebdd16f9f6b74de5b997b76f2c449079f734 /web
parent554981d9d347c88a5c5973aa1fd711676c0cd7e9 (diff)
Add Go code analyzer workflow
Diffstat (limited to 'web')
-rw-r--r--web/controller/index.go10
-rw-r--r--web/service/user.go2
2 files changed, 6 insertions, 6 deletions
diff --git a/web/controller/index.go b/web/controller/index.go
index 605f874f..dd58e5e5 100644
--- a/web/controller/index.go
+++ b/web/controller/index.go
@@ -1,10 +1,10 @@
package controller
import (
+ "fmt"
"net/http"
"text/template"
"time"
- "fmt"
"github.com/mhsanaei/3x-ui/v2/logger"
"github.com/mhsanaei/3x-ui/v2/web/service"
@@ -79,12 +79,12 @@ func (a *IndexController) login(c *gin.Context) {
if user == nil {
logger.Warningf("wrong username: \"%s\", password: \"%s\", IP: \"%s\"", safeUser, safePass, getRemoteIp(c))
-
- notifyPass := safePass
-
+
+ notifyPass := safePass
+
if checkErr != nil && checkErr.Error() == "invalid 2fa code" {
translatedError := a.tgbot.I18nBot("tgbot.messages.2faFailed")
- notifyPass = fmt.Sprintf("*** (%s)", translatedError)
+ notifyPass = fmt.Sprintf("*** (%s)", translatedError)
}
a.tgbot.UserLoginNotify(safeUser, notifyPass, getRemoteIp(c), timeStr, 0)
diff --git a/web/service/user.go b/web/service/user.go
index 0a2a3f3e..6fcf17e7 100644
--- a/web/service/user.go
+++ b/web/service/user.go
@@ -95,7 +95,7 @@ func (s *UserService) CheckUser(username string, password string, twoFactorCode
}
if gotp.NewDefaultTOTP(twoFactorToken).Now() != twoFactorCode {
- return nil, errors.New("invalid 2fa code")
+ return nil, errors.New("invalid 2fa code")
}
}