✨ 优化邮件验证和密码重置链接
- 修改邮件中的验证和重置链接,直接指向 app.html 页面 - 在落地页添加容错脚本,自动重定向带 token 的请求到应用页 - 提升用户体验,减少跳转步骤 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -827,7 +827,7 @@ app.post('/api/register',
|
||||
verification_expires_at: expiresAtMs
|
||||
});
|
||||
|
||||
const verifyLink = `${getProtocol(req)}://${req.get('host')}/?verifyToken=${verifyToken}`;
|
||||
const verifyLink = `${getProtocol(req)}://${req.get('host')}/app.html?verifyToken=${verifyToken}`;
|
||||
|
||||
try {
|
||||
await sendMail(
|
||||
@@ -894,7 +894,7 @@ app.post('/api/resend-verification', [
|
||||
const expiresAtMs = Date.now() + 30 * 60 * 1000;
|
||||
VerificationDB.setVerification(user.id, verifyToken, expiresAtMs);
|
||||
|
||||
const verifyLink = `${getProtocol(req)}://${req.get('host')}/?verifyToken=${verifyToken}`;
|
||||
const verifyLink = `${getProtocol(req)}://${req.get('host')}/app.html?verifyToken=${verifyToken}`;
|
||||
await sendMail(
|
||||
user.email,
|
||||
'邮箱验证 - 玩玩云',
|
||||
@@ -959,7 +959,7 @@ app.post('/api/password/forgot', [
|
||||
const expiresAtMs = Date.now() + 30 * 60 * 1000;
|
||||
PasswordResetTokenDB.create(user.id, token, expiresAtMs);
|
||||
|
||||
const resetLink = `${getProtocol(req)}://${req.get('host')}/?resetToken=${token}`;
|
||||
const resetLink = `${getProtocol(req)}://${req.get('host')}/app.html?resetToken=${token}`;
|
||||
await sendMail(
|
||||
email,
|
||||
'密码重置 - 玩玩云',
|
||||
|
||||
Reference in New Issue
Block a user