1import{a as n,b as g}from"./chunk-N6XGQUGV.js";import{a as v}from"./chunk-VW2GWKBU.js";import{Y as x}from"./chunk-IE3GEG6D.js";import"./chunk-JLQQPUG2.js";import{a as k}from"./chunk-E3GK6ZJN.js";import"./chunk-OYHRIJHA.js";import{H as j,d as I,e as y}from"./chunk-JLTXE2K3.js";import{Ja as r,La as m,Ma as h,V as p,bb as s,cb as l,da as c,db as u,dd as f,fd as d,id as S}from"./chunk-Y66N7V4O.js";import"./chunk-7CEBWOAQ.js";var C=(()=>{let t=class t{constructor(i,e,a){this.auth0=i,this.route=e,this.router=a}ngOnInit(){let i=this.auth0.validateSsoApp(this.route.snapshot.paramMap.get("ssoapp"));if(!i){this.router.navigateByUrl("login");return}this.auth0.localAuthSetup(i),this.auth0.login(i.name)}};t.\u0275fac=function(e){return new(e||t)(r(n),r(f),r(d))},t.\u0275cmp=m({type:t,selectors:[["ng-component"]],standalone:!1,decls:3,vars:0,consts:[["id","app-loading"],["viewBox","25 25 50 50",1,"spinner"],["cx","50","cy","50","r","20","fill","none","stroke-width","2","stroke-miterlimit","10",1,"path"]],template:function(e,a){e&1&&(s(0,"div",0),c(),s(1,"svg",1),u(2,"circle",2),l()())},encapsulation:2});let o=t;return o})();var w=(()=>{let t=class t{constructor(i,e,a,M,R,U,T){this.api=i,this.auth0=e,this.ls=a,this.toast=M,this.route=R,this.router=U,this.user=T}ngOnInit(){if(this.ssoApp=this.auth0.validateSsoApp(this.route.snapshot.paramMap.get("ssoapp")),!this.ssoApp){this.router.navigateByUrl("login");return}this.auth0.handleAuthCallback(this.ssoApp),this.fetchUser()}fetchUser(){this.auth0.accessToken$.subscribe({next:i=>{this.api.fetchSsoUser$(i,this.ssoApp.name).subscribe({next:e=>{this.ls.setItem("sa_sso_app",this.ssoApp.name),this.user.login(e.user,e.token),this.router.navigate([e.redirect_uri])},error:e=>this.handleError(e)})},error:i=>this.handleError(i)})}handleError(i){let e=i.message?i.message:"Something went wrong";e+=" Please try again. You will be redirected to login",this.toast.error(e),setTimeout(()=>this.auth0.logout(this.ssoApp),3e3)}};t.\u0275fac=function(e){return new(e||t)(r(v),r(n),r(y),r(I),r(f),r(d),r(j))},t.\u0275cmp=m({type:t,selectors:[["ng-component"]],standalone:!1,decls:3,vars:0,consts:[["id","app-loading"],["viewBox","25 25 50 50",1,"spinner"],["cx","50","cy","50","r","20","fill","none","stroke-width","2","stroke-miterlimit","10",1,"path"]],template:function(e,a){e&1&&(s(0,"div",0),c(),s(1,"svg",1),u(2,"circle",2),l()())},encapsulation:2});let o=t;return o})();var D=[{path:"",canActivate:[g],children:[{path:"sso/:ssoapp/callback",component:w},{path:"sso/:ssoapp",component:C}]}],b=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=h({type:t}),t.\u0275inj=p({imports:[S.forChild(D),S]});let o=t;return o})();var ft=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=h({type:t}),t.\u0275inj=p({providers:[n,v,g,k],imports:[x,b]});let o=t;return o})();export{ft as SsoModule}; 2//# sourceMappingURL=chunk-EG3S732E.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.