remove excess routes for now
This commit is contained in:
parent
c80fcda493
commit
9edf8846dd
1 changed files with 0 additions and 17 deletions
|
|
@ -18,23 +18,6 @@ router = APIRouter(
|
|||
dependencies=[],
|
||||
)
|
||||
|
||||
@router.get("/me")
|
||||
async def read_users_me(
|
||||
current_user: Annotated[UserBase, Depends(get_current_active_user)],
|
||||
) -> UserPublic:
|
||||
return current_user
|
||||
|
||||
|
||||
def ADMIN(current_user: Annotated[UserInDb, Depends(get_current_user)]):
|
||||
if current_user.role != Role.admin:
|
||||
raise HTTPException(status_code=400, detail="You are not admin")
|
||||
return current_user
|
||||
|
||||
|
||||
@router.get('/home')
|
||||
async def home(current_user : Annotated[UserBase, Depends(ADMIN)]):
|
||||
return {"message" : f"Welcome to home page {current_user.username}"}
|
||||
|
||||
@router.post('/login')
|
||||
async def login_for_access_token(
|
||||
form_data : Annotated[OAuth2PasswordRequestForm, Depends()],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue