Skip to content

Commit

Permalink
Implement frontend profile page
Browse files Browse the repository at this point in the history
  • Loading branch information
S3L1M committed Jul 9, 2023
1 parent 235ee03 commit c07384f
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions frontend-server/html/profile.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>User Profile</title>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Retrieve username and email from session storage
const username = sessionStorage.getItem('_username');
const email = sessionStorage.getItem('_email');

// Display username and email in the respective elements
document.getElementById('username').textContent = username;
document.getElementById('email').textContent = email;

// Add event listener to the logout button
document.getElementById('logout').addEventListener('click', function() {
// Clear session storage variables
sessionStorage.setItem('_username', '');
sessionStorage.setItem('_email', '');

// Redirect to login page or perform other logout actions
window.location.href = 'login.html';
});
});
</script>
</head>
<body>
<h1>User Profile</h1>
<p><strong>Username:</strong> <span id="username"></span></p>
<p><strong>Email:</strong> <span id="email"></span></p>
<button id="logout">Logout</button>
</body>
</html>

0 comments on commit c07384f

Please sign in to comment.