server/auth: updated typing on is_valid_token to agree with the implementation

This commit is contained in:
ReAnzu 2018-03-10 13:22:59 -06:00
parent f19c82d110
commit bc6d2dceb5

View file

@ -1,4 +1,4 @@
from typing import Tuple
from typing import Tuple, Optional
import hashlib
import random
import uuid
@ -81,7 +81,7 @@ def is_valid_password(user: model.User, password: str) -> bool:
return False
def is_valid_token(user_token: model.UserToken) -> bool:
def is_valid_token(user_token: Optional[model.UserToken]) -> bool:
'''
Token must be enabled and if it has an expiration, it must be
greater than now.