import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs/internal/Observable'; @Injectable({ providedIn: 'root', }) export class AuthService { constructor(private http: HttpClient) {} public isLoggedIn(): Observable { return this.http.get(`/Api/Authentication/IsLoggedIn`); } public create(userName: string, password: string): Observable { return this.http.post(`/Api/Authentication/Create`, { userName, password, }); } public login(userName: string, password: string): Observable { return this.http.post(`/Api/Authentication/Login`, { userName, password, }); } public logout() { return this.http.post(`/Api/Authentication/Logout`, {}); } public update(userName: string, password: string): Observable { return this.http.post(`/Api/Authentication/Update`, { userName, password, }); } }