Skip to content

GET /api/v1/users/me #19

Description

@hateofhades

What

Return the current authenticated user's profile.

Why

Required for any frontend to show the logged-in user's info. The simplest protected endpoint — validates the full auth flow end-to-end.

Acceptance Criteria

  • GET /api/v1/users/me (protected)
  • Returns 200 with {"id", "email", "username", "display_name", "bio", "avatar_url", "email_verified_at", "created_at"}
  • Returns 401 if no valid Bearer token
  • cargo doc: public functions and types in this module have /// doc comments; cargo doc --no-deps produces no warnings for this module
  • Bruno collection: docs/bruno/auth/get-me.bru added (or updated) with example request body and expected response shapes; uses {{base_url}} and {{access_token}} variables

Implementation Notes

pub async fn get_me(
    CurrentUser(user): CurrentUser,
) -> impl IntoResponse {
    Json(UserResponse::from(user))
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions