feat: implement GET /users/profile endpoint#54
Merged
ayshadogo merged 2 commits intoDfunder:mainfrom Feb 24, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Adds a profile endpoint so authenticated users can fetch their own account information.
The endpoint pulls the user ID straight from the JWT payload (via the existing @currentuser() decorator) and hits the
database once to return the full profile. Since the global JwtAuthGuard already covers all routes, unauthenticated
requests are rejected with a 401 before they even reach the handler.
The response is mapped explicitly through ProfileResponseDto — the raw User entity is never serialised directly, so
fields like password, refreshTokenHash, and the various reset/verification token columns are structurally impossible to
leak.
Also included is a profileCompletionPercentage field. It scores the account against six checkpoints (basic info, email
verified, wallet linked, KYC approved) and returns a rounded percentage. A brand new account starts at 50% and works up
to 100% as the user completes each step.
UsersService now owns profile fetching rather than delegating to AuthService, which keeps the auth module focused on
token and credential logic.
closes #27