Skip to content

Commit 6006030

Browse files
committed
fix: remove non-existent totp_verified column from SQL queries
1 parent 3442289 commit 6006030

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

internal/routes/totp.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (h *TOTPHandler) VerifyTOTP(w http.ResponseWriter, r *http.Request) {
9191
return
9292
}
9393

94-
database.DB.Exec("UPDATE users SET totp_enabled = TRUE, totp_verified = TRUE, totp_secret = ? WHERE id = ?", secret, user.UserID)
94+
database.DB.Exec("UPDATE users SET totp_enabled = TRUE, totp_secret = ? WHERE id = ?", secret, user.UserID)
9595
services.LogActivity(user.UserID, "totp_verified", "TOTP two-factor authentication verified", nil)
9696

9797
writeJSON(w, http.StatusOK, map[string]interface{}{"success": true})
@@ -129,7 +129,7 @@ func (h *TOTPHandler) EnableTOTP(w http.ResponseWriter, r *http.Request) {
129129
}
130130
hashedJSON, _ := json.Marshal(hashedCodes)
131131

132-
database.DB.Exec("UPDATE users SET totp_enabled = TRUE, totp_verified = TRUE, totp_secret = ?, recovery_codes = ? WHERE id = ?",
132+
database.DB.Exec("UPDATE users SET totp_enabled = TRUE, totp_secret = ?, recovery_codes = ? WHERE id = ?",
133133
secret, string(hashedJSON), user.UserID)
134134
services.LogActivity(user.UserID, "totp_enabled", "TOTP two-factor authentication enabled", nil)
135135

@@ -171,7 +171,7 @@ func (h *TOTPHandler) DisableTOTP(w http.ResponseWriter, r *http.Request) {
171171
return
172172
}
173173

174-
database.DB.Exec("UPDATE users SET totp_enabled = FALSE, totp_verified = FALSE, totp_secret = NULL, recovery_codes = NULL WHERE id = ?", user.UserID)
174+
database.DB.Exec("UPDATE users SET totp_enabled = FALSE, totp_secret = NULL, recovery_codes = NULL WHERE id = ?", user.UserID)
175175
services.LogActivity(user.UserID, "totp_disabled", "TOTP two-factor authentication disabled", nil)
176176

177177
writeJSON(w, http.StatusOK, map[string]interface{}{"success": true})

0 commit comments

Comments
 (0)