Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit 5958d317 authored by 65160394's avatar 65160394
Browse files

Project Round 7

parent fe8e6b60
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ exports.Logout = (req, res) => {
exports.getProfilePage = (req, res) => {
if (req.session.userId) {
// ส่งข้อมูลของผู้ใช้ไปที่หน้าโปรไฟล์
res.render('profile', { user: req.session.userName, session: req.session });
res.render('profile', { user, session: req.session });
} else {
// ถ้าไม่ได้ล็อกอิน ให้ไปที่หน้า login
res.redirect('/login');
......
......@@ -8,7 +8,7 @@
</head>
<body>
<header>
<h1>Welcome, <%= users.name %>!</h1>
<h1>Welcome, <%= user.name %>!</h1>
<nav>
<a href="/">Home</a>
<a href="/logout">Logout</a>
......@@ -18,8 +18,8 @@
<section class="profile-container">
<h2>Your Profile</h2>
<div class="profile-card">
<p><strong>Name:</strong> <%= users.name %></p>
<p><strong>Email:</strong> <%= users.email %></p>
<p><strong>Name:</strong> <%= user.name %></p>
<p><strong>Email:</strong> <%= user.email %></p>
</div>
<a href="/edit-profile" class="btn-edit">Edit Profile</a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment