feat: 2FA authorization for web terminal

This commit is contained in:
Jacky 2024-07-23 20:35:32 +08:00
parent 802d05f692
commit 3a22861640
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
15 changed files with 359 additions and 54 deletions

View file

@ -86,7 +86,7 @@ func Login(c *gin.Context) {
}
// Check if the user enables 2FA
if len(u.OTPSecret) > 0 {
if u.EnabledOTP() {
if json.OTP == "" && json.RecoveryCode == "" {
c.JSON(http.StatusOK, LoginResponse{
Message: "The user has enabled 2FA",