From ba63c1ba1a13cde0b4168e6944049746bcda9fe2 Mon Sep 17 00:00:00 2001 From: Sicherhaven Date: Mon, 23 Mar 2026 16:41:43 +0530 Subject: [PATCH] Add multi-user auth: nafih and vivek accounts Co-Authored-By: Claude Sonnet 4.6 --- server/src/config.ts | 6 ++++-- server/src/routes/auth.ts | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/server/src/config.ts b/server/src/config.ts index 481b11e..9505ca4 100644 --- a/server/src/config.ts +++ b/server/src/config.ts @@ -19,8 +19,10 @@ export const config = { }, port: parseInt(process.env.PORT ?? '3002', 10), auth: { - email: process.env.AUTH_EMAIL ?? 'admin@eventifyplus.com', - password: process.env.AUTH_PASSWORD ?? 'eventify2026', + users: [ + { email: 'nafih@bshtechnologies.in', password: 'Nafih@2020' }, + { email: 'vivek@bshtechnologies.in', password: 'q1w2e3r4' }, + ], jwtSecret: process.env.JWT_SECRET ?? 'eventify-server-monitor-secret-key-change-in-production', }, } as const; diff --git a/server/src/routes/auth.ts b/server/src/routes/auth.ts index 7dc3ac9..1404bc1 100644 --- a/server/src/routes/auth.ts +++ b/server/src/routes/auth.ts @@ -13,7 +13,8 @@ authRouter.post('/login', (req, res) => { return; } - if (email === config.auth.email && password === config.auth.password) { + const user = config.auth.users.find(u => u.email === email && u.password === password); + if (user) { const token = jwt.sign( { email, role: 'admin' }, config.auth.jwtSecret,