Skip to content

Comments

feat: implement GET /users/profile endpoint#54

Merged
ayshadogo merged 2 commits intoDfunder:mainfrom
mftee:userProfile
Feb 24, 2026
Merged

feat: implement GET /users/profile endpoint#54
ayshadogo merged 2 commits intoDfunder:mainfrom
mftee:userProfile

Conversation

@mftee
Copy link
Contributor

@mftee mftee commented Feb 24, 2026

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

@ayshadogo ayshadogo merged commit 08ecf3b into Dfunder:main Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Get User Profile Endpoint

2 participants