Project: Mall App Client: Maiora
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

auth.service.ts 458 B

1234567891011121314151617
  1. import { Injectable } from '@angular/core';
  2. import { HttpClient, HttpHeaders } from '@angular/common/http';
  3. import { URL } from '../mocks/url';
  4. @Injectable({
  5. providedIn: 'root'
  6. })
  7. export class AuthService {
  8. constructor(
  9. private http: HttpClient
  10. ) { }
  11. authenticateUser(credentials: { username: string, password: string, login_type: string }) {
  12. return this.http.post(URL + '/api/auth/signin', credentials).toPromise();
  13. }
  14. }