feat: add boards and tasks management endpoints
This commit is contained in:
15
backend/app/api/auth.py
Normal file
15
backend/app/api/auth.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
|
||||
from app.core.auth import get_auth_context
|
||||
from app.schemas.users import UserRead
|
||||
|
||||
router = APIRouter(prefix="/auth", tags=["auth"])
|
||||
|
||||
|
||||
@router.post("/bootstrap", response_model=UserRead)
|
||||
async def bootstrap_user(auth=Depends(get_auth_context)) -> UserRead:
|
||||
if auth.actor_type != "user" or auth.user is None:
|
||||
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED)
|
||||
return auth.user
|
||||
Reference in New Issue
Block a user