Applicatie afmaken en GUI-flow herstellen
Voegt boodschappenlijsten, productbeheer, realtime synchronisatie en browsercache-updates toe. Herstelt login- en sessiegedrag en maakt database-seeding herhaalbaar.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -19,11 +19,14 @@ class AuthController {
|
||||
|
||||
async register(req, res) {
|
||||
|
||||
const {
|
||||
name,
|
||||
email,
|
||||
password
|
||||
} = req.body;
|
||||
const name = (req.body.name || "").trim();
|
||||
const email = (req.body.email || "").trim().toLowerCase();
|
||||
const password = req.body.password || "";
|
||||
|
||||
if (name.length < 2 || !/^\S+@\S+\.\S+$/.test(email) || password.length < 8) {
|
||||
req.flash("error", "Vul een naam, geldig e-mailadres en een wachtwoord van minimaal 8 tekens in.");
|
||||
return res.redirect("/register");
|
||||
}
|
||||
|
||||
|
||||
const existingUser = db.prepare(
|
||||
@@ -97,10 +100,8 @@ class AuthController {
|
||||
|
||||
async login(req, res) {
|
||||
|
||||
const {
|
||||
email,
|
||||
password
|
||||
} = req.body;
|
||||
const email = (req.body.email || "").trim().toLowerCase();
|
||||
const password = req.body.password || "";
|
||||
|
||||
|
||||
const user = db.prepare(
|
||||
|
||||
Reference in New Issue
Block a user