Files
tehran_taj/apps/user-app/dist/assets/IamCallback-VIY3A5Yp.js
T
2026-10-11 15:24:16 +03:30

2 lines
873 B
JavaScript

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