]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/login/login.component.ts
Add video dropdown in discover page
[github/Chocobozzz/PeerTube.git] / client / src / app / login / login.component.ts
index 5db8d3dbb84ddb22f19978585ece05744885b6ca..fff4b43f6f27f968bdd6cc2129e91dff82b21812 100644 (file)
@@ -10,6 +10,7 @@ import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
 import { ActivatedRoute } from '@angular/router'
 import { ServerConfig, RegisteredExternalAuthConfig } from '@shared/models/server/server-config.model'
 import { environment } from 'src/environments/environment'
+import { HooksService } from '@app/core/plugins/hooks.service'
 
 @Component({
   selector: 'my-login',
@@ -23,7 +24,9 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni
 
   error: string = null
   forgotPasswordEmail = ''
+
   isAuthenticatedWithExternalAuth = false
+  externalAuthError = false
   externalLogins: string[] = []
 
   private openedForgotPasswordModal: NgbModalRef
@@ -38,6 +41,7 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni
     private userService: UserService,
     private redirectService: RedirectService,
     private notifier: Notifier,
+    private hooks: HooksService,
     private i18n: I18n
   ) {
     super()
@@ -61,6 +65,11 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni
       return
     }
 
+    if (snapshot.queryParams.externalAuthError) {
+      this.externalAuthError = true
+      return
+    }
+
     this.buildForm({
       username: this.loginValidatorsService.LOGIN_USERNAME,
       password: this.loginValidatorsService.LOGIN_PASSWORD
@@ -71,6 +80,8 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni
     if (this.usernameInput) {
       this.usernameInput.nativeElement.focus()
     }
+
+    this.hooks.runAction('action:login.init', 'login')
   }
 
   getExternalLogins () {