Initial Switch to V2. Completely Overhauled Backend, Frontend and General Structure.

This commit is contained in:
2026-04-17 14:37:36 +03:00
parent eb773c5531
commit 0a8a42d69b
447 changed files with 70696 additions and 492 deletions

View File

@@ -4,6 +4,7 @@ from auth.models import TokenPayload
from auth.dependencies import require_permission
from users.models import (
UserCreate, UserUpdate, UserInDB, UserListResponse,
SetPasswordRequest, ResetPasswordRequest,
)
from users import service
@@ -95,6 +96,26 @@ async def unassign_device(
return service.unassign_device(user_id, device_id)
@router.post("/{user_id}/set-password", status_code=204)
async def set_password(
user_id: str,
body: SetPasswordRequest,
_user: TokenPayload = Depends(require_permission("app_users", "full_edit")),
):
"""Set a new password for the user via Firebase Auth (requires uid on the user doc)."""
service.set_password(user_id, body.password)
@router.post("/{user_id}/reset-password", status_code=204)
async def reset_password(
user_id: str,
body: ResetPasswordRequest,
_user: TokenPayload = Depends(require_permission("app_users", "full_edit")),
):
"""Reset a user's password to the supplied value (default: Bell1234!)."""
service.set_password(user_id, body.new_password)
@router.post("/{user_id}/photo")
async def upload_photo(
user_id: str,