rsanchez
2017-03-19 280daa7f3f858ecfef9c91ffd5dea1007f021048
securis/src/main/webapp/src/app/user.service.ts
....@@ -28,11 +28,12 @@
2828 let options = new RequestOptions({ headers: new Headers({ "Content-Type": "application/x-www-form-urlencoded" })});
2929 return this.http.post('user/login', params.toString(), options)
3030 .map((resp) => this.mapLogin(resp))
31
- .catch(this.handleError);
31
+ .catch((err) => this.handleError(err));
3232 }
3333
3434 private mapLogin(res : Response) : string {
3535 let data = res.json();
36
+ this.store.set('user_full_name', data.full_name);
3637 this.store.set('username', data.username);
3738 this.store.set('token', data.token);
3839 return <string>data.token;
....@@ -46,7 +47,7 @@
4647 let option = new RequestOptions({ headers: new Headers({ 'X-SECURIS-TOKEN': token }) });
4748 return this.http.get('check', option)
4849 .map((resp) => this.mapCheck(resp))
49
- .catch(this.handleError);
50
+ .catch((err) => this.handleError(err));
5051 }
5152
5253 private mapCheck(res : Response) : boolean {