]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/login/login.component.ts
Implement user blocking on server side
[github/Chocobozzz/PeerTube.git] / client / src / app / login / login.component.ts
index a91522db367e41460592deefd6388ea72f7e7be8..9a68c12faa4d358c74d01f86c9130c08d1de6b87 100644 (file)
@@ -55,7 +55,11 @@ export class LoginComponent extends FormReactive implements OnInit {
       .subscribe(
         () => this.redirectService.redirectToHomepage(),
 
-        err => this.error = err.message
+        err => {
+          if (err.message.indexOf('credentials are invalid') !== -1) this.error = this.i18n('Incorrect username or password.')
+          else if (err.message.indexOf('blocked') !== -1) this.error = this.i18n('You account is blocked.')
+          else this.error = err.message
+        }
       )
   }
 
@@ -64,7 +68,7 @@ export class LoginComponent extends FormReactive implements OnInit {
       .subscribe(
         res => {
           const message = this.i18n(
-            'An email with the reset password instructions will be sent to {{ email }}.',
+            'An email with the reset password instructions will be sent to {{email}}.',
             { email: this.forgotPasswordEmail }
           )
           this.notificationsService.success(this.i18n('Success'), message)