-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.html
More file actions
37 lines (29 loc) · 744 Bytes
/
Copy pathprofile.html
File metadata and controls
37 lines (29 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html>
<head>
<title>My Profile | Civic Bridge</title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/layout.css">
</head>
<body>
<main id="profile"></main>
<script>
const user = JSON.parse(localStorage.getItem("currentUser"));
if (!user || user.role !== "user") {
window.location.href = "login.html";
}
document.getElementById("profile").innerHTML = `
<h2>${user.name}</h2>
<p>${user.email}</p>
<h3>My Issues</h3>
<p>(Your reported issues will appear here)</p>
<button onclick="logout()">Logout</button>
`;
function logout() {
localStorage.removeItem("currentUser");
window.location.href = "index.html";
}
</script>
<script src="js/auth.js"></script>
</body>
</html>