diff --git a/src/api/users.py b/src/api/users.py index 031f6c4..802c5e0 100644 --- a/src/api/users.py +++ b/src/api/users.py @@ -105,6 +105,15 @@ async def get_users() -> list[UserData]: return [UserData.from_user(user) for user in users] +@protected_router.get("/me") +async def get_current_user(user: CurrentUserDep) -> UserData: + """Get the current user. + + This endpoint can also be used to check if the user is authenticated. + """ + return UserData.from_user(user) + + @protected_router.get("/{user_id}") async def get_user(user_id: PydanticObjectId) -> UserData: """Get a specific user."""