Improve logic for token validation

This commit is contained in:
Matthias
2022-09-10 14:19:11 +02:00
parent 2f6a61521f
commit b344f78d00
3 changed files with 16 additions and 29 deletions

View File

@@ -158,12 +158,6 @@ def test_api_auth():
with pytest.raises(HTTPException):
get_user_from_token(b'not_a_token', 'secret1234')
# Check returning false instead of error on bad token
assert not get_user_from_token(b'not_a_token', 'secret1234', raise_on_error=False)
# Check returning false instead of error on bad token type
assert not get_user_from_token(token, 'secret1234', token_type='refresh', raise_on_error=False)
def test_api_ws_auth(botclient):
ftbot, client = botclient