+ User Profile
+ Thanks for supporting us{`, ${state.user.name}!` || '!'}
+ {state.user.id || 'Profile not found'}
+ {state.user.email}
+
+
+
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/client/src/util/apiUtils.ts b/client/src/util/apiUtils.ts
index 98be1c7..7d2130d 100644
--- a/client/src/util/apiUtils.ts
+++ b/client/src/util/apiUtils.ts
@@ -35,5 +35,5 @@ export const handleLogin = async (email: string, password: string) => {
body: JSON.stringify({ email: email, password: password })
});
- if (serverCall.ok) return serverCall;
+ return serverCall;
}
diff --git a/routes/login.js b/routes/login.js
index d36d671..49aa497 100644
--- a/routes/login.js
+++ b/routes/login.js
@@ -19,7 +19,12 @@ loginRouter.route('/').post(async (req, res) => {
req.session.authenticated = true;
req.session.user = { email: email, password: password }
- res.send(req.session);
+ let fullUserProfile = await newClient.query("SELECT * FROM users WHERE email = ($1)", [email]);
+
+ res.send({
+ session: req.session,
+ userProfile: fullUserProfile.rows[0]
+ });
}
} catch(e) {
console.log(e);