From e62631b42ff740289405a8cd19f19643d23901ee Mon Sep 17 00:00:00 2001 From: xfarrow Date: Wed, 28 Feb 2024 15:13:19 +0100 Subject: [PATCH] update front-end --- .../apis/nodejs/src/routes/person_routes.js | 2 +- frontend/vanilla/constants.js | 1 - frontend/vanilla/html/login.html | 20 +++++++++---------- .../html/{myprofile.html => userprofile.html} | 0 frontend/vanilla/js/constants.js | 1 + 5 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 frontend/vanilla/constants.js rename frontend/vanilla/html/{myprofile.html => userprofile.html} (100%) create mode 100644 frontend/vanilla/js/constants.js diff --git a/backend/apis/nodejs/src/routes/person_routes.js b/backend/apis/nodejs/src/routes/person_routes.js index b6115f8..93605b8 100644 --- a/backend/apis/nodejs/src/routes/person_routes.js +++ b/backend/apis/nodejs/src/routes/person_routes.js @@ -88,7 +88,7 @@ async function login (req, res) { const token = jwtUtils.generateToken(person.id); return res.status(200).json({ token }); } else { - return res.status(401).json({ error: 'Unauthorized' }); + return res.status(401).json({ error: 'Invalid credentials' }); } } catch (error) { console.error(`Error in function ${login.name}: ${error}`); diff --git a/frontend/vanilla/constants.js b/frontend/vanilla/constants.js deleted file mode 100644 index 1a47f0c..0000000 --- a/frontend/vanilla/constants.js +++ /dev/null @@ -1 +0,0 @@ -const apiUrl = 'http://localhost:3000/blinkapi'; diff --git a/frontend/vanilla/html/login.html b/frontend/vanilla/html/login.html index 9a87f8b..d1c8311 100644 --- a/frontend/vanilla/html/login.html +++ b/frontend/vanilla/html/login.html @@ -2,7 +2,7 @@ - HTML5 Login Form with validation Example + Log in - Blink @@ -28,6 +28,7 @@ + diff --git a/frontend/vanilla/html/myprofile.html b/frontend/vanilla/html/userprofile.html similarity index 100% rename from frontend/vanilla/html/myprofile.html rename to frontend/vanilla/html/userprofile.html diff --git a/frontend/vanilla/js/constants.js b/frontend/vanilla/js/constants.js new file mode 100644 index 0000000..8c66354 --- /dev/null +++ b/frontend/vanilla/js/constants.js @@ -0,0 +1 @@ +const API_URL = 'http://localhost:3000/api';