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

2 lines
873 B
JavaScript

import{d as n,R as c,o as i,T as o,c as m,B as l,b as p}from"./index-CPBy2Lqe.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};