Files
Arbejd.com-react/src/mvvm/services/auth.service.ts
2026-02-14 10:46:50 +01:00

27 lines
763 B
TypeScript

import { HttpClient, httpClient } from '../core/http-client';
import type { LoginInterface } from "../models/login.interface";
import {environment} from "../../environments/environment";
export class AuthService{
private http: HttpClient
constructor(http: HttpClient = httpClient) {
this.http = http
}
login(username: string, password: string): Promise<LoginInterface>{
let url = environment.backendApi + 'api/1.1.0/candidate/login';
let payload = {
email: username,
password: password
};
return this.http.post(url, payload);
}
forgotPassword(username: string): Promise<any>{
let url = environment.backendApi + 'api/1.1.0/candidate/resetPassword/'+ username.toLowerCase();
return this.http.get(url);
}
}