WIP User service, login routing.

This commit is contained in:
2019-03-02 02:07:56 -06:00
parent a6e8da95f4
commit bcde5fbfc0
3 changed files with 69 additions and 13 deletions

View File

@ -33,7 +33,7 @@ export class PmApiClient {
public getUser(authToken: string): Promise<User> {
return this.http
.get('/user', { headers: { Authorization: 'Bearer ' + authToken }})
.then((resp) => return merge(resp.data, { authToken }); );
.then((resp) => merge(resp.data, { authToken }) );
}
public getAllUsers(user: User): Promise<User[]> {
@ -168,8 +168,9 @@ export class PmApiClient {
.then((resp) => true);
}
private authHeader(user: User): { [key: string]: string } {
return { Authorization: 'Bearer ' + user.authToken };
}
}
export default new PmApiClient(process.env.VUE_APP_PM_API_BASE);