Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/app/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from .ai_scenes import * # noqa: E402, F403
from .apps import * # noqa: E402, F403
from .assets import * # noqa: E402, F403
from .cloud_auth import * # noqa: E402, F403
from .chats import * # noqa: E402, F403
from .frame_bootstrap import * # noqa: E402, F403
from .frames import * # noqa: E402, F403
Expand Down
5 changes: 5 additions & 0 deletions backend/app/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from sqlalchemy.orm import Session
from arq import ArqRedis as Redis
from app import config as app_config
from app.models.cloud_auth import local_fallback_enabled
from app.models.user import User
from app.database import get_db
from app.redis import get_redis
Expand Down Expand Up @@ -152,6 +153,8 @@ async def login(
):
if app_config.config.HASSIO_RUN_MODE is not None:
raise HTTPException(status_code=401, detail="Login not allowed with HASSIO_RUN_MODE")
if not local_fallback_enabled(db):
raise HTTPException(status_code=401, detail="Local login is disabled. Continue with FrameOS Cloud Auth.")
email = form_data.username
password = form_data.password
ip = request.client.host
Expand Down Expand Up @@ -190,6 +193,8 @@ async def login(
async def signup(request: Request, data: UserSignup, response: Response, db: Session = Depends(get_db)):
if app_config.config.HASSIO_RUN_MODE is not None:
raise HTTPException(status_code=401, detail="Signup not allowed with HASSIO_RUN_MODE")
if not local_fallback_enabled(db):
raise HTTPException(status_code=401, detail="Local signup is disabled. Continue with FrameOS Cloud Auth.")

# Check if there is already a user registered (one-user system)
if db.query(User).first() is not None:
Expand Down
Loading
Loading