From adcfe447b91e1796b199cba4701738ef7ba44619 Mon Sep 17 00:00:00 2001
From: Rosanny <rosanny.sihombing@hft-stuttgart.de>
Date: Thu, 19 Mar 2020 09:02:41 +0100
Subject: [PATCH] small update

---
 routes/api.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/routes/api.js b/routes/api.js
index ddedf46c..5a6ee24d 100644
--- a/routes/api.js
+++ b/routes/api.js
@@ -7,13 +7,13 @@ module.exports = function (app) {
     
     app.get('/api/v1/profile', function (req, res) {
         if (req.isAuthenticated()) {
-            // read data based on ID
-            dbconn.user.query('SELECT title, firstname, lastname, email, industry, organisation, speciality FROM user WHERE email="'+req.user.email+'"', function (err, rows, fields) {
+            // read data based on email
+            dbconn.user.query('SELECT * FROM user WHERE email="'+req.user.email+'"', function (err, rows, fields) {
                 if (err) throw err
                 res.send(rows[0])
             })
         } else {
-          res.redirect('/account/');
+          res.send('authentication required');
         }
     });
     
-- 
GitLab