client/login: don't show pw reset w/o working smtp
This commit is contained in:
parent
ee28d95537
commit
b78d018870
3 changed files with 5 additions and 2 deletions
|
@ -43,6 +43,7 @@ function getConfig() {
|
||||||
console.warn('Local config does not exist, ignoring');
|
console.warn('Local config does not exist, ignoring');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config.canSendMails = !!config.smtp.host;
|
||||||
delete config.secret;
|
delete config.secret;
|
||||||
delete config.smtp;
|
delete config.smtp;
|
||||||
delete config.database;
|
delete config.database;
|
||||||
|
|
|
@ -20,7 +20,9 @@
|
||||||
<fieldset class='messages'></fieldset>
|
<fieldset class='messages'></fieldset>
|
||||||
<fieldset class='buttons'>
|
<fieldset class='buttons'>
|
||||||
<input type='submit' value='Log in'/>
|
<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>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,7 +12,7 @@ class LoginView extends BaseView {
|
||||||
|
|
||||||
render(ctx) {
|
render(ctx) {
|
||||||
const target = this.contentHolder;
|
const target = this.contentHolder;
|
||||||
const source = this.template();
|
const source = this.template({canSendMails: config.canSendMails});
|
||||||
|
|
||||||
const form = source.querySelector('form');
|
const form = source.querySelector('form');
|
||||||
const userNameField = source.querySelector('#user-name');
|
const userNameField = source.querySelector('#user-name');
|
||||||
|
|
Loading…
Reference in a new issue