Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
stufisher authored and Maël Gaonach committed Nov 28, 2022
1 parent da2304d commit 4232586
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion pyispyb/app/extensions/auth/bearer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions tests/core/api/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 4232586

Please sign in to comment.