Merge remote-tracking branch 'upstream/master' into email-codes

This commit is contained in:
vpl
2019-08-26 21:38:45 +02:00
12 changed files with 273 additions and 211 deletions

View File

@@ -94,9 +94,7 @@ fn recover(data: JsonUpcase<RecoverTwoFactor>, conn: DbConn) -> JsonResult {
}
// Remove all twofactors from the user
for twofactor in TwoFactor::find_by_user(&user.uuid, &conn) {
twofactor.delete(&conn)?;
}
TwoFactor::delete_all_by_user(&user.uuid, &conn)?;
// Remove the recovery code, not needed without twofactors
user.totp_recover = None;