made some changes

This commit is contained in:
Kayaya
2020-08-06 14:31:07 +01:00
parent d25ebc0d28
commit 4e143a55a4
12 changed files with 142 additions and 115 deletions
+33
View File
@@ -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([''])
})
}
}