This commit is contained in:
Le Deng
2017-03-11 10:34:13 -05:00
parent b3579d50c8
commit d826f575f8
3 changed files with 6 additions and 4 deletions

View File

@@ -274,6 +274,8 @@ export class MyProfileComponent implements OnInit {
},
error => {
this.loggedIn=false;
console.log("inactive session");
this.router.navigate(['/myAccount']);
}
);

View File

@@ -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";