2020-08-06 14:31:07 +01:00
|
|
|
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
|
|
|
|
|
) { }
|
|
|
|
|
|
2020-08-07 10:31:33 +01:00
|
|
|
/* login(postData: any): Observable<any> {
|
2020-08-06 14:31:07 +01:00
|
|
|
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([''])
|
|
|
|
|
})
|
|
|
|
|
|
2020-08-07 10:31:33 +01:00
|
|
|
} */
|
2020-08-06 14:31:07 +01:00
|
|
|
}
|