Begin support for external auths
[oweals/peertube.git] / client / src / app / login / login.component.html
index 3a2d4b8768803867e76f45387dff9af72d6aa884..3e53e58540103d698aacf9b96e670f54031afaca 100644 (file)
@@ -3,59 +3,61 @@
     Login
   </div>
 
-  <div class="alert alert-info" *ngIf="signupAllowed === false" role="alert">
-    <h6 class="alert-heading" i18n>
-      If you are looking for an account…
-    </h6>
+  <ng-container *ngIf="!isAuthenticatedWithExternalAuth">
+    <div class="alert alert-info" *ngIf="signupAllowed === false" role="alert">
+      <h6 class="alert-heading" i18n>
+        If you are looking for an account…
+      </h6>
 
-    <div i18n>
-      Currently this instance doesn't allow for user registration, but you can find an instance
-      that gives you the possibility to sign up for an account and upload your videos there.
+      <div i18n>
+        Currently this instance doesn't allow for user registration, but you can find an instance
+        that gives you the possibility to sign up for an account and upload your videos there.
 
-      <br />
+        <br />
 
-      Find yours among multiple instances at <a class="alert-link" href="https://joinpeertube.org/instances" target="_blank" rel="noopener noreferrer">https://joinpeertube.org/instances</a>.
-    </div>
-  </div>
-
-  <div *ngIf="error" class="alert alert-danger">{{ error }}
-    <span *ngIf="error === 'User email is not verified.'"> <a i18n routerLink="/verify-account/ask-send-email">Request new verification email.</a></span>
-  </div>
-
-  <form role="form" (ngSubmit)="login()" [formGroup]="form">
-    <div class="form-group">
-      <div>
-        <label i18n for="username">User</label>
-        <input
-          type="text" id="username" i18n-placeholder placeholder="Username or email address" required tabindex="1"
-          formControlName="username" class="form-control" [ngClass]="{ 'input-error': formErrors['username'] }" #emailInput
-        >
-        <a i18n *ngIf="signupAllowed === true" routerLink="/signup" class="create-an-account">
-          or create an account
-        </a>
+        Find yours among multiple instances at <a class="alert-link" href="https://joinpeertube.org/instances" target="_blank" rel="noopener noreferrer">https://joinpeertube.org/instances</a>.
       </div>
+    </div>
 
-      <div *ngIf="formErrors.username" class="form-error">
-        {{ formErrors.username }}
-      </div>
+    <div *ngIf="error" class="alert alert-danger">{{ error }}
+      <span *ngIf="error === 'User email is not verified.'"> <a i18n routerLink="/verify-account/ask-send-email">Request new verification email.</a></span>
     </div>
 
-    <div class="form-group">
-      <label i18n for="password">Password</label>
-      <div>
-        <input
-          type="password" name="password" id="password" i18n-placeholder placeholder="Password" required tabindex="2" autocomplete="current-password"
-          formControlName="password" class="form-control" [ngClass]="{ 'input-error': formErrors['password'] }"
-        >
-        <a i18n-title class="forgot-password-button" (click)="openForgotPasswordModal()" title="Click here to reset your password">I forgot my password</a>
+    <form role="form" (ngSubmit)="login()" [formGroup]="form">
+      <div class="form-group">
+        <div>
+          <label i18n for="username">User</label>
+          <input
+            type="text" id="username" i18n-placeholder placeholder="Username or email address" required tabindex="1"
+            formControlName="username" class="form-control" [ngClass]="{ 'input-error': formErrors['username'] }" #emailInput
+          >
+          <a i18n *ngIf="signupAllowed === true" routerLink="/signup" class="create-an-account">
+            or create an account
+          </a>
+        </div>
+
+        <div *ngIf="formErrors.username" class="form-error">
+          {{ formErrors.username }}
+        </div>
       </div>
-      <div *ngIf="formErrors.password" class="form-error">
-        {{ formErrors.password }}
+
+      <div class="form-group">
+        <label i18n for="password">Password</label>
+        <div>
+          <input
+            type="password" name="password" id="password" i18n-placeholder placeholder="Password" required tabindex="2" autocomplete="current-password"
+            formControlName="password" class="form-control" [ngClass]="{ 'input-error': formErrors['password'] }"
+          >
+          <a i18n-title class="forgot-password-button" (click)="openForgotPasswordModal()" title="Click here to reset your password">I forgot my password</a>
+        </div>
+        <div *ngIf="formErrors.password" class="form-error">
+          {{ formErrors.password }}
+        </div>
       </div>
-    </div>
 
-    <input type="submit" i18n-value value="Login" [disabled]="!form.valid">
-  </form>
+      <input type="submit" i18n-value value="Login" [disabled]="!form.valid">
+    </form>
+  </ng-container>
 </div>
 
 <ng-template #forgotPasswordModal>