mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
made some changes
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { StorageService } from './storage.service';
|
||||
import { HttpService } from './http.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AuthConnstants } from '../config/auth-constants';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuthService {
|
||||
|
||||
constructor(
|
||||
private httpService: HttpService,
|
||||
private storageService: StorageService,
|
||||
private router: Router
|
||||
) { }
|
||||
|
||||
login(postData: any): Observable<any> {
|
||||
return this.httpService.post('login', postData);
|
||||
}
|
||||
|
||||
signup(postData: any): Observable<any> {
|
||||
return this.httpService.post('signup', postData);
|
||||
}
|
||||
|
||||
logout(){
|
||||
this.storageService.removeStorageItem(AuthConnstants.AUTH).then(res =>{
|
||||
this.router.navigate([''])
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user