From cc2fab639f6cdb84dbf1ce9fa2f7d4568f877287 Mon Sep 17 00:00:00 2001 From: Ognjen Cirkovic Date: Sat, 26 Mar 2022 23:23:40 +0100 Subject: Omoguceno da guest korisnik dobija Jwt token koji se takodje osvezava.I da moze da posalje temp model. --- frontend/src/app/app.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'frontend/src/app/app.component.ts') diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts index f5ae5786..8c6f8452 100644 --- a/frontend/src/app/app.component.ts +++ b/frontend/src/app/app.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { Title } from '@angular/platform-browser'; import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; import { filter, map } from 'rxjs'; +import { AuthService } from './_services/auth.service'; @Component({ selector: 'app-root', @@ -10,7 +11,7 @@ import { filter, map } from 'rxjs'; }) export class AppComponent implements OnInit { - constructor(private router: Router, private titleService: Title) { } + constructor(private router: Router, private titleService: Title,private authService:AuthService) { } ngOnInit() { this.router.events @@ -33,5 +34,9 @@ export class AppComponent implements OnInit { this.titleService.setTitle(`${title} - Igrannonica`); } }); + if(!this.authService.isAuthenticated()) + { + this.authService.addGuestToken(); + } } } -- cgit v1.2.3