From bd5c83a8cb46eb6da2b25df3b1f6a2a5795d1869 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 20 Jul 2016 16:24:18 +0200 Subject: Client: Add authHttp service that authentificates the http request and optionally refresh the access token if needed --- client/src/app/login/login.component.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'client/src/app/login') diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts index bcfa021fa..ddd62462e 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { Router } from '@angular/router'; -import { AuthService, AuthStatus, User } from '../shared'; +import { AuthService } from '../shared'; @Component({ selector: 'my-login', @@ -21,14 +21,11 @@ export class LoginComponent { result => { this.error = null; - const user = new User(username, result); - user.save(); - - this.authService.setStatus(AuthStatus.LoggedIn); - this.router.navigate(['/videos/list']); }, error => { + console.error(error); + if (error.error === 'invalid_grant') { this.error = 'Credentials are invalid.'; } else { -- cgit v1.2.3