client/login: don't show pw reset w/o working smtp

This commit is contained in:
rr- 2016-04-08 20:09:32 +02:00
parent ee28d95537
commit b78d018870
3 changed files with 5 additions and 2 deletions

View file

@ -43,6 +43,7 @@ function getConfig() {
console.warn('Local config does not exist, ignoring');
}
config.canSendMails = !!config.smtp.host;
delete config.secret;
delete config.smtp;
delete config.database;

View file

@ -20,7 +20,9 @@
<fieldset class='messages'></fieldset>
<fieldset class='buttons'>
<input type='submit' value='Log in'/>
<a href='/password-reset'>Forgot the password?</a>
{{#if this.canSendMails}}
<a href='/password-reset'>Forgot the password?</a>
{{/if}}
</fieldset>
</form>
</div>

View file

@ -12,7 +12,7 @@ class LoginView extends BaseView {
render(ctx) {
const target = this.contentHolder;
const source = this.template();
const source = this.template({canSendMails: config.canSendMails});
const form = source.querySelector('form');
const userNameField = source.querySelector('#user-name');