aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/login
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 /client/src/app/login
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 'client/src/app/login')
-rw-r--r--client/src/app/login/login.component.html7
-rw-r--r--client/src/app/login/login.component.ts9
2 files changed, 10 insertions, 6 deletions
diff --git a/client/src/app/login/login.component.html b/client/src/app/login/login.component.html
index 93dbed525..9b8146624 100644
--- a/client/src/app/login/login.component.html
+++ b/client/src/app/login/login.component.html
@@ -59,7 +59,12 @@
59 </div> 59 </div>
60 60
61 <div class="modal-body"> 61 <div class="modal-body">
62 <div class="form-group"> 62
63 <div *ngIf="isEmailDisabled()" class="alert alert-danger" i18n>
64 We are sorry, you cannot recover you password because your instance administrator did not configure the PeerTube email system.
65 </div>
66
67 <div class="form-group" [hidden]="isEmailDisabled()">
63 <label i18n for="forgot-password-email">Email</label> 68 <label i18n for="forgot-password-email">Email</label>
64 <input 69 <input
65 type="email" id="forgot-password-email" i18n-placeholder placeholder="Email address" required 70 type="email" id="forgot-password-email" i18n-placeholder placeholder="Email address" required
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts
index 7553e6456..212a8ff1f 100644
--- a/client/src/app/login/login.component.ts
+++ b/client/src/app/login/login.component.ts
@@ -19,7 +19,6 @@ import { Router } from '@angular/router'
19export class LoginComponent extends FormReactive implements OnInit { 19export class LoginComponent extends FormReactive implements OnInit {
20 @ViewChild('emailInput') input: ElementRef 20 @ViewChild('emailInput') input: ElementRef
21 @ViewChild('forgotPasswordModal') forgotPasswordModal: ElementRef 21 @ViewChild('forgotPasswordModal') forgotPasswordModal: ElementRef
22 @ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef
23 22
24 error: string = null 23 error: string = null
25 forgotPasswordEmail = '' 24 forgotPasswordEmail = ''
@@ -45,6 +44,10 @@ export class LoginComponent extends FormReactive implements OnInit {
45 return this.serverService.getConfig().signup.allowed === true 44 return this.serverService.getConfig().signup.allowed === true
46 } 45 }
47 46
47 isEmailDisabled () {
48 return this.serverService.getConfig().email.enabled === false
49 }
50
48 ngOnInit () { 51 ngOnInit () {
49 this.buildForm({ 52 this.buildForm({
50 username: this.loginValidatorsService.LOGIN_USERNAME, 53 username: this.loginValidatorsService.LOGIN_USERNAME,
@@ -96,10 +99,6 @@ export class LoginComponent extends FormReactive implements OnInit {
96 ) 99 )
97 } 100 }
98 101
99 onForgotPasswordModalShown () {
100 this.forgotPasswordEmailInput.nativeElement.focus()
101 }
102
103 openForgotPasswordModal () { 102 openForgotPasswordModal () {
104 this.openedForgotPasswordModal = this.modalService.open(this.forgotPasswordModal) 103 this.openedForgotPasswordModal = this.modalService.open(this.forgotPasswordModal)
105 } 104 }