From d826f575f8e706dc4bb630fffe33837d810685ab Mon Sep 17 00:00:00 2001 From: Le Deng Date: Sat, 11 Mar 2017 10:34:13 -0500 Subject: [PATCH] latest --- bookstore-api/.idea/workspace.xml | 4 ++-- .../src/app/components/my-profile/my-profile.component.ts | 2 ++ store-front/src/app/services/login.service.ts | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bookstore-api/.idea/workspace.xml b/bookstore-api/.idea/workspace.xml index cfbff25..d3c9c70 100644 --- a/bookstore-api/.idea/workspace.xml +++ b/bookstore-api/.idea/workspace.xml @@ -1007,12 +1007,12 @@ - + - diff --git a/store-front/src/app/components/my-profile/my-profile.component.ts b/store-front/src/app/components/my-profile/my-profile.component.ts index 8e12dfb..20e6297 100644 --- a/store-front/src/app/components/my-profile/my-profile.component.ts +++ b/store-front/src/app/components/my-profile/my-profile.component.ts @@ -274,6 +274,8 @@ export class MyProfileComponent implements OnInit { }, error => { this.loggedIn=false; + console.log("inactive session"); + this.router.navigate(['/myAccount']); } ); diff --git a/store-front/src/app/services/login.service.ts b/store-front/src/app/services/login.service.ts index 71caa35..b57de39 100644 --- a/store-front/src/app/services/login.service.ts +++ b/store-front/src/app/services/login.service.ts @@ -2,13 +2,13 @@ import { Injectable } from '@angular/core'; import {Http, Headers} from '@angular/http'; import {Observable} from 'rxjs/Observable'; import {AppConst} from '../constants/app-const'; - +import {Router} from "@angular/router"; @Injectable() export class LoginService { private serverPath:string = AppConst.serverPath; - constructor (private http: Http) {} + constructor (private http: Http, private router:Router) {} sendCredential(username: string, password: string) { let url = this.serverPath+"/token";