LifeMate — Personal, Family & Learning Companion
feat: expose authenticated profile user id
davoodmehraban89 committed
Oct 5, 2026 at 15:07 UTC
fff8c184b462c82e6c3a6e96b13006302007b7fe
1 file changed
+1
-1
backend/src/server.js
+1
-1
@@ -374,7 +374,7 @@ app.post('/v1/auth/logout', auth, async (req, res) => {
374
375
app.get('/v1/profile', auth, async (req, res) => {
376
const r = await pool.query(
377
- 'select p.display_name,p.birth_date,p.theme_preference,u.email_normalized,u.email_verified_at from profile p join app_user u on u.id=p.user_id where p.user_id=$1',
377
+ 'select u.id as user_id,p.display_name,p.birth_date,p.theme_preference,u.email_normalized,u.email_verified_at from profile p join app_user u on u.id=p.user_id where p.user_id=$1',
378
[req.identity.sub],
379
);
380
if (!r.rowCount) return res.status(404).json({ error: 'profile_not_found' });