Devices have replaced Clients for authentication as well as location using sections.

Printing of reports done.
Main section is now a fixture

User and Devices list gives last login details.
This commit is contained in:
2020-10-27 16:59:24 +05:30
parent cbc2f29e29
commit f8683cf080
32 changed files with 335 additions and 291 deletions

View File

@ -4,7 +4,9 @@ import { BehaviorSubject, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { environment } from '../../environments/environment';
import { Device } from '../core/device';
import { User } from '../core/user';
import { CookieService } from '../shared/cookie.service';
const loginUrl = '/token';
const refreshUrl = '/refresh';
@ -14,10 +16,14 @@ const JWT_USER = 'JWT_USER';
export class AuthService {
private currentUserSubject: BehaviorSubject<User>;
public currentUser: Observable<User>;
public device: Device;
constructor(private http: HttpClient) {
constructor(private http: HttpClient, private cs: CookieService) {
this.checkStorage();
this.currentUser = this.currentUserSubject.asObservable();
const deviceId = this.cs.getCookie('device_id');
const device = this.cs.getCookie('device');
this.device = new Device({ id: deviceId, name: device });
}
static parseJwt(token): User {