[auth] dont activate authenticationMiddleware if secret is missing. NO SECRET ONLY IN FULLY PUBLIC DOMAINS!!!

This commit is contained in:
Maxime Alves LIRMM@home 2022-01-21 14:39:34 +01:00
parent 979007f287
commit 2e5680d29a

View File

@ -129,6 +129,7 @@ class HalfAPI(Starlette):
self.add_route('/', JSONRoute(schemas)) self.add_route('/', JSONRoute(schemas))
if SECRET:
self.add_middleware( self.add_middleware(
AuthenticationMiddleware, AuthenticationMiddleware,
backend=JWTAuthenticationBackend() backend=JWTAuthenticationBackend()