Changed to local requests

This commit is contained in:
ItzMineyy committed 2024-12-28 15:05:22 +01:00
1 parent cedaa2e414
commit d310ef72ee
1 file changed
+2 -2
+2 -2
View File
@@ -7,12 +7,12 @@ import {Observable, tap} from 'rxjs';
}) })
export class AuthService { export class AuthService {
private apiUrl = 'http://localhost:7020/api/auth/login'; // Replace with your API endpoint private apiUrl = '/api/auth/login'; // Replace with your API endpoint
constructor(private http: HttpClient) {} constructor(private http: HttpClient) {}
login(username: string, password: string): Observable<any> { login(username: string, password: string): Observable<any> {
return this.http.post('http://localhost:7020/api/auth/login', { username, password }) return this.http.post(this.apiUrl, { username, password })
.pipe( .pipe(
tap((response: any) => { tap((response: any) => {
// Store token in localStorage after successful login // Store token in localStorage after successful login