mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
WebAdmin: allow to disable 2FA
Before it was only possible using REST API Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -134,6 +134,10 @@ func disableUser2FA(w http.ResponseWriter, r *http.Request) {
|
||||
sendAPIResponse(w, r, err, "", getRespStatus(err))
|
||||
return
|
||||
}
|
||||
if !user.Filters.TOTPConfig.Enabled {
|
||||
sendAPIResponse(w, r, nil, "two-factor authentication is not enabled", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
user.Filters.RecoveryCodes = nil
|
||||
user.Filters.TOTPConfig = dataprovider.UserTOTPConfig{
|
||||
Enabled: false,
|
||||
|
||||
Reference in New Issue
Block a user