diff --git a/backend/app/dto/auth.go b/backend/app/dto/auth.go index 467bfa55f..1b385f378 100644 --- a/backend/app/dto/auth.go +++ b/backend/app/dto/auth.go @@ -9,7 +9,6 @@ type UserLoginInfo struct { Name string `json:"name"` Token string `json:"token"` MfaStatus string `json:"mfaStatus"` - MfaSecret string `json:"mfaSecret"` } type MfaCredential struct { @@ -28,7 +27,6 @@ type Login struct { type MFALogin struct { Name string `json:"name"` Password string `json:"password"` - Secret string `json:"secret"` Code string `json:"code"` AuthMethod string `json:"authMethod"` } diff --git a/backend/app/service/auth.go b/backend/app/service/auth.go index bc6e64110..a16f4b342 100644 --- a/backend/app/service/auth.go +++ b/backend/app/service/auth.go @@ -86,9 +86,9 @@ func (u *AuthService) MFALogin(c *gin.Context, info dto.MFALogin) (*dto.UserLogi } pass, err := encrypt.StringDecrypt(passwrodSetting.Value) if err != nil { - return nil, constant.ErrAuth + return nil, err } - if info.Password != pass && nameSetting.Value != info.Name { + if info.Password != pass || nameSetting.Value != info.Name { return nil, constant.ErrAuth } diff --git a/frontend/src/api/interface/auth.ts b/frontend/src/api/interface/auth.ts index 49ef2f4b8..4c2a88eb6 100644 --- a/frontend/src/api/interface/auth.ts +++ b/frontend/src/api/interface/auth.ts @@ -9,7 +9,6 @@ export namespace Login { export interface MFALoginForm { name: string; password: string; - secret: string; code: string; authMethod: string; } @@ -17,7 +16,6 @@ export namespace Login { name: string; token: string; mfaStatus: string; - mfaSecret: string; } export interface InitUser { name: string; diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 823a582d7..deeda9f0e 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -120,6 +120,8 @@ const message = { warnning: 'Note: [Closing the security entrance] will make your panel login address directly exposed to the Internet, very dangerous, please exercise caution', codeInput: 'Please enter the 6-digit verification code of the MFA validator', + mfaTitle: 'MFA Certification', + mfaCode: 'MFA verification code', title: 'Linux Server Management Panel', licenseHelper: 'Agree to FIT2CLOUD « Community Software License Agreement »', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 9cfac2eaa..6a8f77903 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -123,7 +123,8 @@ const message = { solutionHelper: '在 SSH 终端输入以下一种命令来解决 1.查看面板入口:/etc/init.d/bt default', warnning: '注意:【关闭安全入口】将使您的面板登录地址被直接暴露在互联网上,非常危险,请谨慎操作', codeInput: '请输入 MFA 验证器的 6 位验证码', - mfaTitle: 'MFA认证', + mfaTitle: 'MFA 认证', + mfaCode: 'MFA 验证码', title: 'Linux 服务器运维管理面板', licenseHelper: '同意 FIT2CLOUD 飞致云 « 社区软件许可协议 »', diff --git a/frontend/src/views/login/components/login-form.vue b/frontend/src/views/login/components/login-form.vue index 4d067457e..9f4453f20 100644 --- a/frontend/src/views/login/components/login-form.vue +++ b/frontend/src/views/login/components/login-form.vue @@ -1,5 +1,5 @@