mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: better err reporting & init private endpoint
This commit is contained in:
parent
8f8257b9e7
commit
6137c907d2
4 changed files with 30 additions and 9 deletions
|
|
@ -90,4 +90,6 @@ async def get_current_user(request: Request, Authorize: AuthJWT = Depends()):
|
|||
else:
|
||||
return AnonymousUser()
|
||||
|
||||
|
||||
async def non_public_endpoint(current_user: PublicUser ):
|
||||
if isinstance(current_user, AnonymousUser):
|
||||
raise HTTPException(status_code=401, detail="Not authenticated")
|
||||
Loading…
Add table
Add a link
Reference in a new issue