Initial React project
This commit is contained in:
26
src/mvvm/services/auth.service.ts
Normal file
26
src/mvvm/services/auth.service.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user