aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/auth/auth.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/auth/auth.service.ts')
-rw-r--r--client/src/app/core/auth/auth.service.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts
index 06ffa1a42..a56adbbad 100644
--- a/client/src/app/core/auth/auth.service.ts
+++ b/client/src/app/core/auth/auth.service.ts
@@ -7,6 +7,8 @@ import 'rxjs/add/operator/map';
7import 'rxjs/add/operator/mergeMap'; 7import 'rxjs/add/operator/mergeMap';
8import 'rxjs/add/observable/throw'; 8import 'rxjs/add/observable/throw';
9 9
10import { NotificationsService } from 'angular2-notifications';
11
10// Do not use the barrel (dependency loop) 12// Do not use the barrel (dependency loop)
11import { AuthStatus } from '../../shared/auth/auth-status.model'; 13import { AuthStatus } from '../../shared/auth/auth-status.model';
12import { AuthUser } from '../../shared/auth/auth-user.model'; 14import { AuthUser } from '../../shared/auth/auth-user.model';
@@ -27,6 +29,7 @@ export class AuthService {
27 29
28 constructor( 30 constructor(
29 private http: Http, 31 private http: Http,
32 private notificationsService: NotificationsService,
30 private restExtractor: RestExtractor, 33 private restExtractor: RestExtractor,
31 private router: Router 34 private router: Router
32 ) { 35 ) {
@@ -44,11 +47,14 @@ export class AuthService {
44 this.clientSecret = result.client_secret; 47 this.clientSecret = result.client_secret;
45 console.log('Client credentials loaded.'); 48 console.log('Client credentials loaded.');
46 }, 49 },
50
47 error => { 51 error => {
48 alert( 52 let errorMessage = `Cannot retrieve OAuth Client credentials: ${error.text}. \n`;
49 `Cannot retrieve OAuth Client credentials: ${error.text}. \n` + 53 errorMessage += 'Ensure you have correctly configured PeerTube (config/ directory), in particular the "webserver" section.';
50 'Ensure you have correctly configured PeerTube (config/ directory), in particular the "webserver" section.' 54
51 ); 55 // We put a bigger timeout
56 // This is an important message
57 this.notificationsService.error('Error', errorMessage, { timeOut: 7000 });
52 } 58 }
53 ); 59 );
54 60