[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_route('/', JSONRoute(schemas))
|
||||||
|
|
||||||
self.add_middleware(
|
if SECRET:
|
||||||
AuthenticationMiddleware,
|
self.add_middleware(
|
||||||
backend=JWTAuthenticationBackend()
|
AuthenticationMiddleware,
|
||||||
)
|
backend=JWTAuthenticationBackend()
|
||||||
|
)
|
||||||
|
|
||||||
if not PRODUCTION:
|
if not PRODUCTION:
|
||||||
self.add_middleware(
|
self.add_middleware(
|
||||||
|
Loading…
Reference in New Issue
Block a user