diff --git a/pyispyb/app/extensions/auth/bearer.py b/pyispyb/app/extensions/auth/bearer.py index bab0bcac..b9076696 100644 --- a/pyispyb/app/extensions/auth/bearer.py +++ b/pyispyb/app/extensions/auth/bearer.py @@ -4,7 +4,7 @@ from ...globals import g from .token import decode_token, set_token_data -from .onetime import expire_onetime_tokens, onetime, validate_onetime_token +from .onetime import onetime, validate_onetime_token # auto_error=False to correct 403 -> 401 # https://github.com/tiangolo/fastapi/issues/2026 diff --git a/tests/core/api/test_authentication.py b/tests/core/api/test_authentication.py index ea8c4f54..137e7bba 100644 --- a/tests/core/api/test_authentication.py +++ b/tests/core/api/test_authentication.py @@ -64,9 +64,3 @@ def test_onetime(client: TestClient): res = client.get(f"{settings.api_root}/events?onetime={res2.json()['token']}") assert res.status_code == 200 - - -def test_onetime_expired(client: TestClient): - res = client.get(f"{settings.api_root}/events?onetime=one") - assert res.status_code == 401 - assert "invalid" in res.json()["detail"].lower()