{"ast":null,"code":"import * as i0 from \"@angular/core\";\nimport * as i1 from \"../shared/services/authentication.service\";\nimport * as i2 from \"@angular/router\";\nexport class AuthGuard {\n  constructor(authService, router) {\n    this.authService = authService;\n    this.router = router;\n  }\n  canActivate(next, state) {\n    if (this.authService.isUserAuthenticated()) {\n      return true;\n    }\n    this.router.navigate(['/authentication/login'], {\n      queryParams: {\n        returnUrl: state.url\n      }\n    });\n    return false;\n  }\n  static #_ = this.ɵfac = function AuthGuard_Factory(t) {\n    return new (t || AuthGuard)(i0.ɵɵinject(i1.AuthenticationService), i0.ɵɵinject(i2.Router));\n  };\n  static #_2 = this.ɵprov = /*@__PURE__*/i0.ɵɵdefineInjectable({\n    token: AuthGuard,\n    factory: AuthGuard.ɵfac,\n    providedIn: 'root'\n  });\n}","map":{"version":3,"names":["AuthGuard","constructor","authService","router","canActivate","next","state","isUserAuthenticated","navigate","queryParams","returnUrl","url","_","i0","ɵɵinject","i1","AuthenticationService","i2","Router","_2","factory","ɵfac","providedIn"],"sources":["C:\\Users\\fsengul\\Desktop\\MendereIT\\InventoryManagement\\InventryUI-Client\\src\\app\\guards\\auth.guard.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree } from '@angular/router';\nimport { AuthenticationService } from '../shared/services/authentication.service';\n\n\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class AuthGuard  {\n\n  constructor(private authService: AuthenticationService, private router: Router){}\n  \n  canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot) { \n    if (this.authService.isUserAuthenticated()) {\n      return true;\n    }\n    this.router.navigate(['/authentication/login'], { queryParams: { returnUrl: state.url }});\n    \n    return false;\n  } \n  \n}\n"],"mappings":";;;AASA,OAAM,MAAOA,SAAS;EAEpBC,YAAoBC,WAAkC,EAAUC,MAAc;IAA1D,KAAAD,WAAW,GAAXA,WAAW;IAAiC,KAAAC,MAAM,GAANA,MAAM;EAAU;EAEhFC,WAAWA,CAACC,IAA4B,EAAEC,KAA0B;IAClE,IAAI,IAAI,CAACJ,WAAW,CAACK,mBAAmB,EAAE,EAAE;MAC1C,OAAO,IAAI;IACb;IACA,IAAI,CAACJ,MAAM,CAACK,QAAQ,CAAC,CAAC,uBAAuB,CAAC,EAAE;MAAEC,WAAW,EAAE;QAAEC,SAAS,EAAEJ,KAAK,CAACK;MAAG;IAAE,CAAC,CAAC;IAEzF,OAAO,KAAK;EACd;EAAC,QAAAC,CAAA,G;qBAXUZ,SAAS,EAAAa,EAAA,CAAAC,QAAA,CAAAC,EAAA,CAAAC,qBAAA,GAAAH,EAAA,CAAAC,QAAA,CAAAG,EAAA,CAAAC,MAAA;EAAA;EAAA,QAAAC,EAAA,G;WAATnB,SAAS;IAAAoB,OAAA,EAATpB,SAAS,CAAAqB,IAAA;IAAAC,UAAA,EAFR;EAAM","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}