mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-09 15:05:26 +03:00
return 404 from /api/login if auth is disabled
This commit is contained in:
parent
882b3a8ffd
commit
f9e4134381
@ -812,6 +812,11 @@ limiter = Limiter(key_func=get_remote_addr)
|
|||||||
)
|
)
|
||||||
@limiter.limit(limit_value=rateLimiter.get_limit)
|
@limiter.limit(limit_value=rateLimiter.get_limit)
|
||||||
def login(request: Request, body: AppPostLoginBody):
|
def login(request: Request, body: AppPostLoginBody):
|
||||||
|
if not request.app.frigate_config.auth.enabled:
|
||||||
|
return JSONResponse(
|
||||||
|
content={"message": "Authentication is disabled"}, status_code=404
|
||||||
|
)
|
||||||
|
|
||||||
JWT_COOKIE_NAME = request.app.frigate_config.auth.cookie_name
|
JWT_COOKIE_NAME = request.app.frigate_config.auth.cookie_name
|
||||||
JWT_COOKIE_SECURE = request.app.frigate_config.auth.cookie_secure
|
JWT_COOKIE_SECURE = request.app.frigate_config.auth.cookie_secure
|
||||||
JWT_SESSION_LENGTH = request.app.frigate_config.auth.session_length
|
JWT_SESSION_LENGTH = request.app.frigate_config.auth.session_length
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user