diff options
author | Chocobozzz <me@florianbigard.com> | 2020-04-30 15:03:09 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-05-04 16:21:39 +0200 |
commit | bc90883f1a5e9c4ecb76ae358734b85be515af7f (patch) | |
tree | 47d578c1d5a3a95e89f2badfade76b125de11084 /client/src | |
parent | a4995eb7ac5745f62604d70f7b2225ff33916d49 (diff) | |
download | PeerTube-bc90883f1a5e9c4ecb76ae358734b85be515af7f.tar.gz PeerTube-bc90883f1a5e9c4ecb76ae358734b85be515af7f.tar.zst PeerTube-bc90883f1a5e9c4ecb76ae358734b85be515af7f.zip |
Handle external login errors
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/login/login.component.html | 10 | ||||
-rw-r--r-- | client/src/app/login/login.component.scss | 9 | ||||
-rw-r--r-- | client/src/app/login/login.component.ts | 7 |
3 files changed, 17 insertions, 9 deletions
diff --git a/client/src/app/login/login.component.html b/client/src/app/login/login.component.html index b0639d8ca..a935c86c3 100644 --- a/client/src/app/login/login.component.html +++ b/client/src/app/login/login.component.html | |||
@@ -3,7 +3,11 @@ | |||
3 | Login | 3 | Login |
4 | </div> | 4 | </div> |
5 | 5 | ||
6 | <ng-container *ngIf="!isAuthenticatedWithExternalAuth"> | 6 | <div class="alert alert-danger" i18n *ngIf="externalAuthError"> |
7 | Sorry but there was an issue with the external login process. Please <a routerLink="/about">contact an administrator</a>. | ||
8 | </div> | ||
9 | |||
10 | <ng-container *ngIf="!externalAuthError && !isAuthenticatedWithExternalAuth"> | ||
7 | <div class="alert alert-info" *ngIf="signupAllowed === false" role="alert"> | 11 | <div class="alert alert-info" *ngIf="signupAllowed === false" role="alert"> |
8 | <h6 class="alert-heading" i18n> | 12 | <h6 class="alert-heading" i18n> |
9 | If you are looking for an account… | 13 | If you are looking for an account… |
@@ -63,8 +67,8 @@ | |||
63 | <div class="external-login-blocks" *ngIf="getExternalLogins().length !== 0"> | 67 | <div class="external-login-blocks" *ngIf="getExternalLogins().length !== 0"> |
64 | <div class="block-title" i18n>Or sign in with</div> | 68 | <div class="block-title" i18n>Or sign in with</div> |
65 | 69 | ||
66 | <div class="external-login-block"> | 70 | <div> |
67 | <a *ngFor="let auth of getExternalLogins()" [href]="getAuthHref(auth)" role="button"> | 71 | <a class="external-login-block" *ngFor="let auth of getExternalLogins()" [href]="getAuthHref(auth)" role="button"> |
68 | {{ auth.authDisplayName }} | 72 | {{ auth.authDisplayName }} |
69 | </a> | 73 | </a> |
70 | </div> | 74 | </div> |
diff --git a/client/src/app/login/login.component.scss b/client/src/app/login/login.component.scss index ccc98c12a..db9f78f7c 100644 --- a/client/src/app/login/login.component.scss +++ b/client/src/app/login/login.component.scss | |||
@@ -38,7 +38,6 @@ input[type=submit] { | |||
38 | } | 38 | } |
39 | 39 | ||
40 | .external-login-blocks { | 40 | .external-login-blocks { |
41 | padding: 0 10px 10px 10px; | ||
42 | min-width: 200px; | 41 | min-width: 200px; |
43 | 42 | ||
44 | .block-title { | 43 | .block-title { |
@@ -46,9 +45,12 @@ input[type=submit] { | |||
46 | } | 45 | } |
47 | 46 | ||
48 | .external-login-block { | 47 | .external-login-block { |
48 | @include disable-default-a-behaviour; | ||
49 | |||
49 | cursor: pointer; | 50 | cursor: pointer; |
50 | border: 1px solid #d1d7e0; | 51 | border: 1px solid #d1d7e0; |
51 | border-radius: 5px; | 52 | border-radius: 5px; |
53 | color: var(--mainForegroundColor); | ||
52 | margin: 10px 10px 0 0; | 54 | margin: 10px 10px 0 0; |
53 | display: flex; | 55 | display: flex; |
54 | justify-content: center; | 56 | justify-content: center; |
@@ -59,11 +61,6 @@ input[type=submit] { | |||
59 | &:hover { | 61 | &:hover { |
60 | background-color: rgba(209, 215, 224, 0.5) | 62 | background-color: rgba(209, 215, 224, 0.5) |
61 | } | 63 | } |
62 | |||
63 | a { | ||
64 | @include disable-default-a-behaviour; | ||
65 | color: var(--mainForegroundColor); | ||
66 | } | ||
67 | } | 64 | } |
68 | } | 65 | } |
69 | } | 66 | } |
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts index 5db8d3dbb..5d935cb49 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts | |||
@@ -23,7 +23,9 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni | |||
23 | 23 | ||
24 | error: string = null | 24 | error: string = null |
25 | forgotPasswordEmail = '' | 25 | forgotPasswordEmail = '' |
26 | |||
26 | isAuthenticatedWithExternalAuth = false | 27 | isAuthenticatedWithExternalAuth = false |
28 | externalAuthError = false | ||
27 | externalLogins: string[] = [] | 29 | externalLogins: string[] = [] |
28 | 30 | ||
29 | private openedForgotPasswordModal: NgbModalRef | 31 | private openedForgotPasswordModal: NgbModalRef |
@@ -61,6 +63,11 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni | |||
61 | return | 63 | return |
62 | } | 64 | } |
63 | 65 | ||
66 | if (snapshot.queryParams.externalAuthError) { | ||
67 | this.externalAuthError = true | ||
68 | return | ||
69 | } | ||
70 | |||
64 | this.buildForm({ | 71 | this.buildForm({ |
65 | username: this.loginValidatorsService.LOGIN_USERNAME, | 72 | username: this.loginValidatorsService.LOGIN_USERNAME, |
66 | password: this.loginValidatorsService.LOGIN_PASSWORD | 73 | password: this.loginValidatorsService.LOGIN_PASSWORD |