Skip to content

Commit

Permalink
Added workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
huziibee committed Jan 8, 2024
1 parent d91c904 commit 9a65a97
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion AWS-APP/Dashboard/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ document.addEventListener('DOMContentLoaded', function() {


if (!sessionStorage.getItem('username')) {
window.location.href = '../Login/index.html';
window.location.href = '../index.html';
}


Expand Down
2 changes: 1 addition & 1 deletion AWS-APP/Register/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2>Sign Up</h2>
<button class="formbtn" type="submit">Sign Up</button>
<p>
Already have an account?
<a class="signup-atag" href="../Login/index.html"> <b> Sign in! </b> </a>
<a class="signup-atag" href="../index.html"> <b> Sign in! </b> </a>
</p>
</form>
</div>
Expand Down
4 changes: 2 additions & 2 deletions AWS-APP/Verification/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
})

Expand Down Expand Up @@ -40,6 +40,6 @@ function verifyUser(otpCode) {
return;
}
alert(result);
window.location.href = '../Login/index.html';
window.location.href = '../index.html';
});
}
8 changes: 4 additions & 4 deletions AWS-APP/Login/index.html → AWS-APP/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Login</title>
<link rel="stylesheet" href="../styles.css" />
<link rel="stylesheet" href="./styles.css" />
</head>
<body>
<div class="login-container">
Expand All @@ -22,11 +22,11 @@ <h2>Login</h2>
<button class="formbtn" type="submit">Login</button>
<p>
Don't have an account?
<a class="signup-atag" href="../Register/signup.html"> <b> Sign up! </b> </a>
<a class="signup-atag" href="./Register/signup.html"> <b> Sign up! </b> </a>
</p>
</form>
</div>
<script type="text/javascript" src="../utils/amazon-cognito-identity.min.js"></script>
<script src="login.js"></script>
<script type="text/javascript" src="./utils/amazon-cognito-identity.min.js"></script>
<script src="scripts.js"></script>
</body>
</html>
6 changes: 1 addition & 5 deletions AWS-APP/Login/login.js → AWS-APP/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, () => {
Expand Down

0 comments on commit 9a65a97

Please sign in to comment.