48ea61cdcc
- Product documentation in docs/products/ - Updated MEMORY.md with product info - quiXzoom Auth Core as AAMOS Identity product
7 lines
1.2 KiB
JavaScript
7 lines
1.2 KiB
JavaScript
import{o as l,r as i}from"./index-oAPVDf-r.js";/**
|
|
* @license lucide-react v0.462.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const f=l("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);function u(){return localStorage.getItem("qz_token")??""}function h(s){const[r,a]=i.useState({achievedIAL:null,isVerified:!1,isLoading:!1,expiresAt:null,error:null}),n=i.useCallback(async()=>{if(s){a(t=>({...t,isLoading:!0,error:null}));try{const t=await fetch("https://api.quixzoom.com/api/qz/identity/status",{headers:{Authorization:`Bearer ${u()}`}});if(!t.ok)throw new Error(`HTTP ${t.status}`);const e=await t.json();a({achievedIAL:e.assurance_level==="photo_low"?"IAL2":e.assurance_level==="nfc_verified"?"IAL3":e.ial??null,isVerified:e.verified===!0,isLoading:!1,expiresAt:e.verified_at??e.expires_at??null,error:null})}catch(t){a(e=>({...e,isLoading:!1,error:t.message}))}}},[s]),c=i.useCallback(t=>{const e=["IAL1","IAL2","IAL3"],o=r.achievedIAL;return o?e.indexOf(o)>=e.indexOf(t):!1},[r.achievedIAL]);return{...r,checkStatus:n,meetsIAL:c}}export{f as A,h as u};
|