This commit is contained in:
2025-12-02 14:07:35 +01:00
commit 9b84566eb4
62 changed files with 12861 additions and 0 deletions

28
app/routers/auth.py Normal file
View File

@@ -0,0 +1,28 @@
from fastapi import APIRouter, Request, Depends
from fastapi.responses import HTMLResponse, JSONResponse
from fastapi.templating import Jinja2Templates
from app.services.tidal_wrapper import TidalWrapper
router = APIRouter(prefix="/auth", tags=["auth"])
templates = Jinja2Templates(directory="app/templates")
@router.get("/login", response_class=HTMLResponse)
async def login_page(request: Request):
return templates.TemplateResponse("login.html", {"request": request})
@router.post("/start")
async def start_login():
wrapper = TidalWrapper()
result = wrapper.start_device_login()
return JSONResponse(result)
@router.get("/status")
async def check_status():
wrapper = TidalWrapper()
return JSONResponse(wrapper.get_auth_status())
@router.post("/logout")
async def logout():
# wrapper = TidalWrapper()
# wrapper.logout()
return JSONResponse({"status": "logged_out"})