mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-12 19:57:37 +00:00
feat(auth): redesign Login and Setup pages with split-panel branding layout (#153)
Replace plain Card-based Login and Setup forms with a professional split-panel layout: always-dark branding panel (dot grid texture, logo, tagline, cyan accent line) on the left, theme-aware form on the right. Mobile collapses to single column with compact logo header. - Add optional admin email field on Setup for license recovery - Backend accepts and stores admin_email in setup endpoint - Fix data-stacks-loaded attribute forwarding (wrap in div, use string values)
This commit is contained in:
@@ -277,7 +277,7 @@ app.post('/api/auth/setup', authRateLimiter, async (req: Request, res: Response)
|
||||
return;
|
||||
}
|
||||
|
||||
const { username, password, confirmPassword } = req.body;
|
||||
const { username, password, confirmPassword, admin_email } = req.body;
|
||||
|
||||
// Validation
|
||||
if (!username || !password || !confirmPassword) {
|
||||
@@ -307,6 +307,10 @@ app.post('/api/auth/setup', authRateLimiter, async (req: Request, res: Response)
|
||||
dbSvc.updateGlobalSetting('auth_password_hash', passwordHash);
|
||||
dbSvc.updateGlobalSetting('auth_jwt_secret', jwtSecret);
|
||||
|
||||
if (admin_email && typeof admin_email === 'string') {
|
||||
dbSvc.updateGlobalSetting('admin_email', admin_email.trim());
|
||||
}
|
||||
|
||||
// Issue JWT and log user in
|
||||
const token = jwt.sign({ username }, jwtSecret, { expiresIn: '24h' });
|
||||
res.cookie(COOKIE_NAME, token, getCookieOptions(req));
|
||||
|
||||
Reference in New Issue
Block a user