diff options
author | 2024-08-19 04:48:40 +0100 | |
---|---|---|
committer | 2024-08-19 04:48:40 +0100 | |
commit | 523cf6ced7e5ed29045b73fb78bbffbf9cac8ea2 (patch) | |
tree | 79b464bdf4e6cc5c3a51bccfab4254804cce7617 /thallium-backend | |
parent | Slim down generated Scalar documentation (diff) |
Change scheme from token to bearer
Diffstat (limited to 'thallium-backend')
-rw-r--r-- | thallium-backend/src/auth.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/thallium-backend/src/auth.py b/thallium-backend/src/auth.py index e72ac3a..b0a37b5 100644 --- a/thallium-backend/src/auth.py +++ b/thallium-backend/src/auth.py @@ -32,14 +32,14 @@ class TokenAuth(HTTPBase): allow_vouchers: bool = False, allow_regular_users: bool = False, ) -> None: - super().__init__(scheme="token", auto_error=auto_error) + super().__init__(scheme="bearer", auto_error=auto_error) self.allow_vouchers = allow_vouchers self.allow_regular_users = allow_regular_users async def __call__(self, request: Request) -> HTTPAuthorizationCredentials: """Parse the token in the auth header, and check it matches with the expected token.""" creds: HTTPAuthorizationCredentials = await super().__call__(request) - if creds.scheme.lower() != "token": + if creds.scheme.lower() != "bearer": raise HTTPException( status_code=401, detail="Incorrect scheme passed", |