From 9a65a97237cdc334ce291f5b6015c3105f68c889 Mon Sep 17 00:00:00 2001 From: huziibee Date: Mon, 8 Jan 2024 17:38:44 +0200 Subject: [PATCH] Added workflow --- AWS-APP/Dashboard/scripts.js | 2 +- AWS-APP/Register/signup.html | 2 +- AWS-APP/Verification/verify.js | 4 ++-- AWS-APP/{Login => }/index.html | 8 ++++---- AWS-APP/{Login/login.js => scripts.js} | 6 +----- server.js | 2 +- 6 files changed, 10 insertions(+), 14 deletions(-) rename AWS-APP/{Login => }/index.html (72%) rename AWS-APP/{Login/login.js => scripts.js} (88%) diff --git a/AWS-APP/Dashboard/scripts.js b/AWS-APP/Dashboard/scripts.js index 200c124..6b823ef 100644 --- a/AWS-APP/Dashboard/scripts.js +++ b/AWS-APP/Dashboard/scripts.js @@ -127,7 +127,7 @@ document.addEventListener('DOMContentLoaded', function() { if (!sessionStorage.getItem('username')) { - window.location.href = '../Login/index.html'; + window.location.href = '../index.html'; } diff --git a/AWS-APP/Register/signup.html b/AWS-APP/Register/signup.html index 7d1b2df..56ce673 100644 --- a/AWS-APP/Register/signup.html +++ b/AWS-APP/Register/signup.html @@ -21,7 +21,7 @@

Sign Up

Already have an account? - +

diff --git a/AWS-APP/Verification/verify.js b/AWS-APP/Verification/verify.js index 0079e3a..7b0ed22 100644 --- a/AWS-APP/Verification/verify.js +++ b/AWS-APP/Verification/verify.js @@ -6,7 +6,7 @@ const userPool = new AmazonCognitoIdentity.CognitoUserPool({ document.addEventListener('DOMContentLoaded', function() { if (!sessionStorage.getItem('username')) { - window.location.href = '../Login/index.html'; + window.location.href = '../index.html'; } }) @@ -40,6 +40,6 @@ function verifyUser(otpCode) { return; } alert(result); - window.location.href = '../Login/index.html'; + window.location.href = '../index.html'; }); } diff --git a/AWS-APP/Login/index.html b/AWS-APP/index.html similarity index 72% rename from AWS-APP/Login/index.html rename to AWS-APP/index.html index ff4790c..b6a1608 100644 --- a/AWS-APP/Login/index.html +++ b/AWS-APP/index.html @@ -5,7 +5,7 @@ Login - +
@@ -22,11 +22,11 @@

Login

Don't have an account? - +

- - + + diff --git a/AWS-APP/Login/login.js b/AWS-APP/scripts.js similarity index 88% rename from AWS-APP/Login/login.js rename to AWS-APP/scripts.js index 4c2c3e9..d6dca46 100644 --- a/AWS-APP/Login/login.js +++ b/AWS-APP/scripts.js @@ -5,11 +5,7 @@ const userPool = new AmazonCognitoIdentity.CognitoUserPool({ ClientId: '23hinerifjsno4tbq6bbrcencc', // Generated in the Cognito User Pool settings }); -document.addEventListener('DOMContentLoaded', function() { - if (window.location.href !== '../Login/index.html' ) { - window.location.href = '../Login/index.html'; - } -}) + function loginUser(name, password) { const authenticationDetails = new AmazonCognitoIdentity.AuthenticationDetails({ diff --git a/server.js b/server.js index 98dd5d9..464d922 100644 --- a/server.js +++ b/server.js @@ -15,7 +15,7 @@ app.use(bodyParser.json()); app.use(cors()); app.get('*', (req, res) => { - res.sendFile(path.join(__dirname, './AWS-APP/Login/index.html')); + res.sendFile(path.join(__dirname, './AWS-APP/index.html')); }); app.listen( process.env.PORT || port, () => {