Skip to content

Commit

Permalink
Signed-off-by: one230six <723682061@qq.com> (#4422)
Browse files Browse the repository at this point in the history
Signed-off-by: one230six <723682061@qq.com>
  • Loading branch information
one230six authored Mar 17, 2024
1 parent 6d73f30 commit d86c4f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/core/two_factor/authenticator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pub async fn validate_totp_code(
let time = (current_timestamp + step * 30i64) as u64;
let generated = totp_custom::<Sha1>(30, 6, &decoded_secret, time);

// Check the the given code equals the generated and if the time_step is larger then the one last used.
// Check the given code equals the generated and if the time_step is larger then the one last used.
if generated == totp_code && time_step > i64::from(twofactor.last_used) {
// If the step does not equals 0 the time is drifted either server or client side.
if step != 0 {
Expand Down

0 comments on commit d86c4f2

Please sign in to comment.