From 3c5eccb9330cdf4604b17d25d2220f3210a67095 Mon Sep 17 00:00:00 2001
From: 65160381 <65160381@go.buu.ac.th>
Date: Tue, 25 Mar 2025 01:10:10 +0700
Subject: [PATCH] 7.5

---
 app.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app.js b/app.js
index 586cfd3..d21b948 100644
--- a/app.js
+++ b/app.js
@@ -95,13 +95,15 @@ app.post('/register', async (req, res) => {
             [email, hashedPassword]
         );
 
-        res.status(201).json({ message: 'User registered successfully' });
+        // หลังจากสมัครเสร็จแล้ว Redirect ไปหน้า Login
+        res.redirect('/login');
     } catch (error) {
         console.error('❌ Registration failed:', error);
         res.status(500).json({ error: 'Registration failed' });
     }
 });
 
+
 app.post('/login', async (req, res) => {
     const { email, password } = req.body;
 
-- 
GitLab