mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-03-17 22:36:17 +00:00
add initial implementation of auth gateway with models, routes, and session management
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import pyotp
|
||||
|
||||
|
||||
def verify_totp(secret: str, token: str) -> bool:
|
||||
normalized_secret = secret.strip()
|
||||
normalized_token = token.strip().replace(" ", "")
|
||||
if not normalized_secret or not normalized_token:
|
||||
return False
|
||||
return pyotp.TOTP(normalized_secret).verify(normalized_token, valid_window=1)
|
||||
Reference in New Issue
Block a user