1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Creating a user with an empty password will send an email to let him set his password (#2479)

* Creating a user with an empty password will send an email to let him set his password

* Consideration of Chocobozzz's comments

* Tips for optional password

* API documentation

* Fix circular imports

* Tests
This commit is contained in:
John Livingston 2020-02-17 10:16:52 +01:00 committed by GitHub
parent c5621bd23b
commit 45f1bd72a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 201 additions and 18 deletions

View file

@ -384,6 +384,22 @@ class Emailer {
return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload })
}
addPasswordCreateEmailJob (username: string, to: string, resetPasswordUrl: string) {
const text = 'Hi,\n\n' +
`Welcome to your ${WEBSERVER.HOST} PeerTube instance. Your username is: ${username}.\n\n` +
`Please set your password by following this link: ${resetPasswordUrl} (this link will expire within seven days).\n\n` +
'Cheers,\n' +
`${CONFIG.EMAIL.BODY.SIGNATURE}`
const emailPayload: EmailPayload = {
to: [ to ],
subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'New PeerTube account password',
text
}
return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload })
}
addVerifyEmailJob (to: string, verifyEmailUrl: string) {
const text = 'Welcome to PeerTube,\n\n' +
`To start using PeerTube on ${WEBSERVER.HOST} you must verify your email! ` +