def load_login_token(site, site_url, token):
    try:
        token_data = signing.loads(
            token, salt=site_url, max_age=settings.AUTH_TOKEN_SECONDS_VALID)
        # site_url in the token seems like an overkill. site_url is
        # already used as salt which should give adequate protection
        # against using a token for sites different than the one for
        # which the token was generated.
        if token_data['site'] != site_url:
            return None
        email = token_data['email']
        timestamp = token_data['timestamp']
        user = site.users.find_item_by_email(email)
        if user is not None and user.last_login is not None:
            if _datetime_to_timestamp(user.last_login) != timestamp:
                return None
        elif timestamp != 0:
            return None
        return email
    except signing.BadSignature:
        return None
A database for rate limiting API requests.
dataset/ETHPy150Open wrr/wwwhisper/wwwhisper_auth/login_token.py/load_login_token--crossover with--dataset/ETHPy150Open clips/pattern/pattern/server/__init__.py/RateLimit.__init__