import { HttpClient } from '@angular/http/common';
import { Injectable } from '@angular/core';
export class AuthService {
constructor(private http: HttpClient) {}
login(username, password) {
this.http.post(`${ BASE_URL }/auth/login`, payload)
.pipe(map(response => response.json()))
authData => this.storeToken(authData.id_token),
(err) => console.error(err),
() => console.log('Authentication Complete')