import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import { URL } from '../mocks/url'; @Injectable({ providedIn: 'root' }) export class AuthService { constructor( private http: HttpClient ) { } authenticateUser(credentials: { username: string, password: string, login_type: string }) { return this.http.post(URL + '/api/auth/signin', credentials).toPromise(); } }