| .. | .. |
|---|
| 28 | 28 | let options = new RequestOptions({ headers: new Headers({ "Content-Type": "application/x-www-form-urlencoded" })}); |
|---|
| 29 | 29 | return this.http.post('user/login', params.toString(), options) |
|---|
| 30 | 30 | .map((resp) => this.mapLogin(resp)) |
|---|
| 31 | | - .catch(this.handleError); |
|---|
| 31 | + .catch((err) => this.handleError(err)); |
|---|
| 32 | 32 | } |
|---|
| 33 | 33 | |
|---|
| 34 | 34 | private mapLogin(res : Response) : string { |
|---|
| 35 | 35 | let data = res.json(); |
|---|
| 36 | + this.store.set('user_full_name', data.full_name); |
|---|
| 36 | 37 | this.store.set('username', data.username); |
|---|
| 37 | 38 | this.store.set('token', data.token); |
|---|
| 38 | 39 | return <string>data.token; |
|---|
| .. | .. |
|---|
| 46 | 47 | let option = new RequestOptions({ headers: new Headers({ 'X-SECURIS-TOKEN': token }) }); |
|---|
| 47 | 48 | return this.http.get('check', option) |
|---|
| 48 | 49 | .map((resp) => this.mapCheck(resp)) |
|---|
| 49 | | - .catch(this.handleError); |
|---|
| 50 | + .catch((err) => this.handleError(err)); |
|---|
| 50 | 51 | } |
|---|
| 51 | 52 | |
|---|
| 52 | 53 | private mapCheck(res : Response) : boolean { |
|---|