Add multi-user auth: nafih and vivek accounts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user