|
|
|
@ -42,7 +42,8 @@ app.post('/api/forget', async (req, res) => {
|
|
|
|
|
expiresIn: '12h' |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const vurl = req.protocol + '://' + req.get('host') + syzoj.utils.makeUrl(['api', 'forget_confirm'], { token: token }); |
|
|
|
|
const currentProto = req.get("X-Forwarded-Proto") || req.protocol; |
|
|
|
|
const vurl = currentProto + '://' + req.get('host') + syzoj.utils.makeUrl(['api', 'forget_confirm'], { token: token }); |
|
|
|
|
try { |
|
|
|
|
await Email.send(user.email, |
|
|
|
|
`${user.username} 的 ${syzoj.config.title} 密码重置邮件`, |
|
|
|
@ -92,7 +93,8 @@ app.post('/api/sign_up', async (req, res) => {
|
|
|
|
|
expiresIn: '2d' |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const vurl = req.protocol + '://' + req.get('host') + syzoj.utils.makeUrl(['api', 'sign_up_confirm'], { token: token }); |
|
|
|
|
const currentProto = req.get("X-Forwarded-Proto") || req.protocol; |
|
|
|
|
const vurl = currentProto + '://' + req.get('host') + syzoj.utils.makeUrl(['api', 'sign_up_confirm'], { token: token }); |
|
|
|
|
try { |
|
|
|
|
await Email.send(req.body.email, |
|
|
|
|
`${req.body.username} 的 ${syzoj.config.title} 注册验证邮件`, |
|
|
|
|