Skip to content

fix: attach only safe user fields to req.user#20

Open
ethnic17 wants to merge 1 commit into
bsoc-bitbyte:mainfrom
ethnic17:fix/req-user
Open

fix: attach only safe user fields to req.user#20
ethnic17 wants to merge 1 commit into
bsoc-bitbyte:mainfrom
ethnic17:fix/req-user

Conversation

@ethnic17

Copy link
Copy Markdown

What

Updated the auth middleware to only fetch safe user fields using Prisma select. Also simplified the /me route to return req.user directly because it contains safe fields.

Fixes #17

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Proof of work

Tested /api/v1/auth/me locally and verified that the response now only contains the safe selected user fields:
id, email, name, picture, phone, thumbsUp, thumbsDown

Checklist

  • I claimed this issue before starting work
  • Branch name follows the convention (feature/, fix/, docs/)
  • Commits follow Conventional Commits format
  • CI is passing (lint, prettier, build)
  • I have self-reviewed my own code
  • Any non-obvious decisions are explained with a comment in the code

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.

[BUG] Full user record is getting attached req.user

1 participant