aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/emailer.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-12-05 15:10:45 +0100
committerChocobozzz <me@florianbigard.com>2018-12-05 15:10:45 +0100
commit3b3b18203fe73e499bf8b49b15369710df95993e (patch)
tree7f682442453bf126fb0acc20ada2593dcc2ae3ae /server/lib/emailer.ts
parent56af5222c1ab3d6aaa76b1237bfa381ecc4878b1 (diff)
downloadPeerTube-3b3b18203fe73e499bf8b49b15369710df95993e.tar.gz
PeerTube-3b3b18203fe73e499bf8b49b15369710df95993e.tar.zst
PeerTube-3b3b18203fe73e499bf8b49b15369710df95993e.zip
Add error when email system is not configured and using the forgot
password system
Diffstat (limited to 'server/lib/emailer.ts')
-rw-r--r--server/lib/emailer.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts
index 9327792fb..074d4ad44 100644
--- a/server/lib/emailer.ts
+++ b/server/lib/emailer.ts
@@ -14,6 +14,7 @@ class Emailer {
14 private static instance: Emailer 14 private static instance: Emailer
15 private initialized = false 15 private initialized = false
16 private transporter: Transporter 16 private transporter: Transporter
17 private enabled = false
17 18
18 private constructor () {} 19 private constructor () {}
19 20
@@ -50,6 +51,8 @@ class Emailer {
50 tls, 51 tls,
51 auth 52 auth
52 }) 53 })
54
55 this.enabled = true
53 } else { 56 } else {
54 if (!isTestInstance()) { 57 if (!isTestInstance()) {
55 logger.error('Cannot use SMTP server because of lack of configuration. PeerTube will not be able to send mails!') 58 logger.error('Cannot use SMTP server because of lack of configuration. PeerTube will not be able to send mails!')
@@ -57,6 +60,10 @@ class Emailer {
57 } 60 }
58 } 61 }
59 62
63 isEnabled () {
64 return this.enabled
65 }
66
60 async checkConnectionOrDie () { 67 async checkConnectionOrDie () {
61 if (!this.transporter) return 68 if (!this.transporter) return
62 69