diff --git a/src/routes/adminConfig.js b/src/routes/adminConfig.js index 15bfbcc..02dc465 100644 --- a/src/routes/adminConfig.js +++ b/src/routes/adminConfig.js @@ -66,11 +66,12 @@ router.post('/config/test-email', async function(req, res) { } var emailWrapper = require('./auth').__emailWrapper; - var btnStyle = require('./auth').__btnStyle; + var btnHtml = require('./auth').__btnHtml; var html = emailWrapper( - '
' + bodyText.replace(/\n/g, '
') + '
Test Email
' + + '' + bodyText.replace(/\n/g, '
') + '
| - - |
+
+
+
|
| - ${escHtml(label)} - |
| + ${escHtml(label)} + |
Button not working? Copy this link into your browser:
-${escHtml(url)}
`; + return `+ Or copy and paste this link into your browser: +
+${escHtml(url)}
`; } // Email helper — DB settings override env vars @@ -183,11 +212,11 @@ router.get('/verify-email', async (req, res) => { if (!token) return res.status(400).send('Missing token'); var user = await db.get('SELECT id, name FROM users WHERE verify_token = ? AND verify_expires > ?', [token, Date.now()]); if (!user) { - return res.send('Link expired or invalid
This verification link has expired. Request a new one from the app.
Go to app'); } await db.run('UPDATE users SET email_verified = true, verify_token = NULL, verify_expires = NULL WHERE id = ?', [user.id]); await db.run('INSERT INTO audit_log (user_id, action) VALUES (?, ?)', [user.id, 'email_verified']); - res.send('Welcome, ' + escHtml(user.name) + '!
'); + res.send('Email verified
Welcome, ' + escHtml(user.name) + '. You\'re all set.
Open app'); } catch (err) { console.error('[Auth] Verify error:', err.message); res.status(500).send('Verification failed. Please try again.'); } });