Accept future OTP code
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-25 17:18:08 +01:00
parent 5b35ec6cf0
commit b704e9868b
2 changed files with 14 additions and 3 deletions

View File

@ -38,9 +38,10 @@ pub async fn save_totp_factor(
if !key.check_code(&form.first_code).unwrap_or(false) {
return HttpResponse::BadRequest().body(format!(
"Given code is invalid (expected {} or {})!",
"Given code is invalid (expected {}, {} or {})!",
key.previous_code().unwrap_or_default(),
key.current_code().unwrap_or_default(),
key.previous_code().unwrap_or_default()
key.following_code().unwrap_or_default(),
));
}