proper admin page fix

This commit is contained in:
2025-06-28 10:14:56 -07:00
parent 14cdcbd675
commit 324dca1637
@@ -22,10 +22,15 @@ export class NewItemComponent {
constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) { constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) {
this.title.setTitle("New | ADMIN"); this.title.setTitle("New | ADMIN");
if (auth.isLoggedIn){
if (auth.loggedInUser.siteData.role != "Admin"){ // If user is not logged in -> route home
router.navigate(["/"]); if (!auth.isLoggedIn){
} router.navigate(["/"]);
}
// If user is not Admin -> route home
if (auth.loggedInUser.siteData.role != "Admin"){
router.navigate(["/"]);
} }
}; };