mirror of
https://github.com/HeyPuter/puter.git
synced 2025-01-23 22:40:20 +08:00
Add password change notification
This commit is contained in:
parent
65b489883d
commit
45e7f162a2
@ -66,6 +66,10 @@ router.post('/passwd', auth, express.json(), async (req, res, next)=>{
|
|||||||
[await bcrypt.hash(req.body.new_pass, 8), req.user.id]
|
[await bcrypt.hash(req.body.new_pass, 8), req.user.id]
|
||||||
);
|
);
|
||||||
invalidate_cached_user(req.user);
|
invalidate_cached_user(req.user);
|
||||||
|
|
||||||
|
const svc_email = req.services.get('email');
|
||||||
|
svc_email.send_email({ email: user.email }, 'password_change_notification');
|
||||||
|
|
||||||
return res.send('Password successfully updated.')
|
return res.send('Password successfully updated.')
|
||||||
}
|
}
|
||||||
}catch(e){
|
}catch(e){
|
||||||
|
@ -69,6 +69,17 @@ If this was not you, please contact support@puter.com immediately.
|
|||||||
</p>
|
</p>
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
'password_change_notification': {
|
||||||
|
subject: '\u{1f511} Password change notification',
|
||||||
|
html: /*html*/`
|
||||||
|
<p>Hi there,</p>
|
||||||
|
<p>
|
||||||
|
We're sending an email to let you know about a change to your account.
|
||||||
|
Your password was recently changed. If this was not you, please contact
|
||||||
|
support@puter.com immediately.
|
||||||
|
</p>
|
||||||
|
`,
|
||||||
|
},
|
||||||
'email_verification_code': {
|
'email_verification_code': {
|
||||||
subject: `{{code}} is your confirmation code`,
|
subject: `{{code}} is your confirmation code`,
|
||||||
html: /*html*/`
|
html: /*html*/`
|
||||||
|
Loading…
Reference in New Issue
Block a user