From 707726463a52cb2cebf9a174149995852632d26d Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sat, 17 Oct 2026 11:50:34 -0700 Subject: Allow for the clock to be slightly behind --- roseh.moe.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roseh.moe.go') diff --git a/roseh.moe.go b/roseh.moe.go index 2640250..0369740 100644 --- a/roseh.moe.go +++ b/roseh.moe.go @@ -813,7 +813,7 @@ func totp(t int64) []byte { func checkOTP(auth string) int { now := time.Now().Unix() / 30 - return subtle.ConstantTimeCompare([]byte(auth), totp(now)) | subtle.ConstantTimeCompare([]byte(auth), totp(now-1)) + return subtle.ConstantTimeCompare([]byte(auth), totp(now-1)) | subtle.ConstantTimeCompare([]byte(auth), totp(now)) | subtle.ConstantTimeCompare([]byte(auth), totp(now+1)) } func checkPassword(password string) int { -- cgit v1.3.1