[auth] dont activate authenticationMiddleware if secret is missing. NO SECRET ONLY IN FULLY PUBLIC DOMAINS!!!
This commit is contained in:
parent
979007f287
commit
2e5680d29a
|
@ -129,10 +129,11 @@ class HalfAPI(Starlette):
|
|||
|
||||
self.add_route('/', JSONRoute(schemas))
|
||||
|
||||
self.add_middleware(
|
||||
AuthenticationMiddleware,
|
||||
backend=JWTAuthenticationBackend()
|
||||
)
|
||||
if SECRET:
|
||||
self.add_middleware(
|
||||
AuthenticationMiddleware,
|
||||
backend=JWTAuthenticationBackend()
|
||||
)
|
||||
|
||||
if not PRODUCTION:
|
||||
self.add_middleware(
|
||||
|
|
Loading…
Reference in New Issue