def token(data, config):
    token = generate(data, config['SECRET_KEY'])
    tokens.add(token)
    return token
예제 #2
0
def test_generated_token_contains_user_id(data, key):
    token = generate(data, key)

    result = verify_to_value(token, key)

    assert result == data
예제 #3
0
def expired_token(data, key):
    return generate(data, key, exp=0)
예제 #4
0
def test_generated_token_is_string(data, key):
    token = generate(data, key)

    assert isinstance(token, six.string_types)
예제 #5
0
def token(data, key):
    return generate(data, key)