Files
tehran_tala/apps/user-app/dist/assets/IamCallback-Dw2ofNbP.js
T

2 lines
782 B
JavaScript

import{d as c,Q as n,o as i,x as o,c as l,C as m,b as p}from"./index-bXlTbVTS.js";const d={style:{"min-height":"100vh",display:"grid","place-items":"center"}},_=c({__name:"IamCallback",setup(g){const a=m(),s=n();return i(async()=>{const e=new URLSearchParams(window.location.search);if(sessionStorage.setItem("gb_iam_sso_checked","1"),e.get("error")||!e.get("code")||!e.get("state")){await a.replace({name:"login"});return}try{const t=await o.ssoCallback(e.get("code"),e.get("state"));s.login(t.token,t.customer.id,t.customer.mobile);try{const r=await o.getExpertIdentity();s.setSalesExpert(r.isSalesExpert)}catch{s.setSalesExpert(!1)}await a.replace({name:"home"})}catch{await a.replace({name:"login"})}}),(e,t)=>(p(),l("div",d,"در حال ورود..."))}});export{_ as default};