css: ''
}
},
+ email: {
+ enabled: false
+ },
serverVersion: 'Unknown',
signup: {
allowed: false,
</div>
<div class="modal-body">
- <div class="form-group">
+
+ <div *ngIf="isEmailDisabled()" class="alert alert-danger" i18n>
+ We are sorry, you cannot recover you password because your instance administrator did not configure the PeerTube email system.
+ </div>
+
+ <div class="form-group" [hidden]="isEmailDisabled()">
<label i18n for="forgot-password-email">Email</label>
<input
type="email" id="forgot-password-email" i18n-placeholder placeholder="Email address" required
export class LoginComponent extends FormReactive implements OnInit {
@ViewChild('emailInput') input: ElementRef
@ViewChild('forgotPasswordModal') forgotPasswordModal: ElementRef
- @ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef
error: string = null
forgotPasswordEmail = ''
return this.serverService.getConfig().signup.allowed === true
}
+ isEmailDisabled () {
+ return this.serverService.getConfig().email.enabled === false
+ }
+
ngOnInit () {
this.buildForm({
username: this.loginValidatorsService.LOGIN_USERNAME,
)
}
- onForgotPasswordModalShown () {
- this.forgotPasswordEmailInput.nativeElement.focus()
- }
-
openForgotPasswordModal () {
this.openedForgotPasswordModal = this.modalService.open(this.forgotPasswordModal)
}
import { auditLoggerFactory, CustomConfigAuditView, getAuditIdFromRes } from '../../helpers/audit-logger'
import { remove, writeJSON } from 'fs-extra'
import { getServerCommit } from '../../helpers/utils'
+import { Emailer } from '../../lib/emailer'
const packageJSON = require('../../../../package.json')
const configRouter = express.Router()
css: CONFIG.INSTANCE.CUSTOMIZATIONS.CSS
}
},
+ email: {
+ enabled: Emailer.Instance.isEnabled()
+ },
serverVersion: packageJSON.version,
serverCommit,
signup: {
private static instance: Emailer
private initialized = false
private transporter: Transporter
+ private enabled = false
private constructor () {}
tls,
auth
})
+
+ this.enabled = true
} else {
if (!isTestInstance()) {
logger.error('Cannot use SMTP server because of lack of configuration. PeerTube will not be able to send mails!')
}
}
+ isEnabled () {
+ return this.enabled
+ }
+
async checkConnectionOrDie () {
if (!this.transporter) return
}
}
+ email: {
+ enabled: boolean
+ }
+
signup: {
allowed: boolean,
allowedForCurrentIP: boolean,