diff --git a/backend/src/controllers/user.ts b/backend/src/controllers/user.ts index 1798b50..e882cbe 100644 --- a/backend/src/controllers/user.ts +++ b/backend/src/controllers/user.ts @@ -92,10 +92,15 @@ export const loginUser = async ( if (!user) { throw ValidationError.USER_NOT_FOUND; } - - res - .status(200) - .json({ uid: user._id, role: user.accountType, approvalStatus: user.approvalStatus }); + res.status(200).json({ + uid: user._id, + role: user.accountType, + approvalStatus: user.approvalStatus, + profilePicture: user.profilePicture, + name: user.name, + email: user.email, + lastChangedPassword: user.lastChangedPassword, + }); return; } catch (e) { nxt(); diff --git a/frontend/src/pages/profile.tsx b/frontend/src/pages/profile.tsx index 808d80b..7e9d3f5 100644 --- a/frontend/src/pages/profile.tsx +++ b/frontend/src/pages/profile.tsx @@ -31,9 +31,7 @@ export default function Profile() { if (!piaUser) return; if (piaUser.profilePicture === "default") { setBasicInfoData((prev) => ({ ...prev, image: "default" })); - return; - } - if (piaUser.profilePicture) { + } else if (piaUser.profilePicture) { getPhoto(piaUser.profilePicture).then( (result) => { if (result.success) {