Skip to content
Snippets Groups Projects
Unverified Commit d86c4f2c authored by one230six's avatar one230six Committed by GitHub
Browse files

Signed-off-by: one230six <723682061@qq.com> (#4422)


Signed-off-by: default avatarone230six <723682061@qq.com>
parent 6d73f30b
No related branches found
No related tags found
No related merge requests found
...@@ -156,7 +156,7 @@ pub async fn validate_totp_code( ...@@ -156,7 +156,7 @@ pub async fn validate_totp_code(
let time = (current_timestamp + step * 30i64) as u64; let time = (current_timestamp + step * 30i64) as u64;
let generated = totp_custom::<Sha1>(30, 6, &decoded_secret, time); 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 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 the step does not equals 0 the time is drifted either server or client side.
if step != 0 { if step != 0 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment