diff --git a/client/src/app/auth.service.ts b/client/src/app/auth.service.ts index 56d5a39..47e5b76 100644 --- a/client/src/app/auth.service.ts +++ b/client/src/app/auth.service.ts @@ -1,44 +1,45 @@ +import { APP_BASE_HREF } from '@angular/common'; import { HttpClient } from '@angular/common/http'; -import { Injectable } from '@angular/core'; +import { Inject, Injectable } from '@angular/core'; import { Observable } from 'rxjs/internal/Observable'; @Injectable({ providedIn: 'root', }) export class AuthService { - constructor(private http: HttpClient) {} + constructor(private http: HttpClient, @Inject(APP_BASE_HREF) private baseHref: string) {} public isLoggedIn(): Observable { - return this.http.get(`/Api/Authentication/IsLoggedIn`); + return this.http.get(`${this.baseHref}Api/Authentication/IsLoggedIn`); } public create(userName: string, password: string): Observable { - return this.http.post(`/Api/Authentication/Create`, { + return this.http.post(`${this.baseHref}Api/Authentication/Create`, { userName, password, }); } public setupProvider(provider: string, token: string): Observable { - return this.http.post(`/Api/Authentication/SetupProvider`, { + return this.http.post(`${this.baseHref}Api/Authentication/SetupProvider`, { provider, token, }); } public login(userName: string, password: string): Observable { - return this.http.post(`/Api/Authentication/Login`, { + return this.http.post(`${this.baseHref}Api/Authentication/Login`, { userName, password, }); } public logout() { - return this.http.post(`/Api/Authentication/Logout`, {}); + return this.http.post(`${this.baseHref}Api/Authentication/Logout`, {}); } public update(userName: string, password: string): Observable { - return this.http.post(`/Api/Authentication/Update`, { + return this.http.post(`${this.baseHref}Api/Authentication/Update`, { userName, password, }); diff --git a/client/src/app/login/login.component.html b/client/src/app/login/login.component.html index 465b3a4..87fcb3f 100644 --- a/client/src/app/login/login.component.html +++ b/client/src/app/login/login.component.html @@ -3,7 +3,7 @@
- +
diff --git a/client/src/app/navbar/navbar.component.html b/client/src/app/navbar/navbar.component.html index 69f3e49..b944756 100644 --- a/client/src/app/navbar/navbar.component.html +++ b/client/src/app/navbar/navbar.component.html @@ -1,7 +1,7 @@