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:
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user