corellium-typescript
Version:
A beautiful TypeScript Corellium library.
1 lines • 395 B
JavaScript
;exports.createTokenEndpoints=(t,e)=>({create:async()=>{const a=new URL("/api/v1/auth/apitoken",t),o=await fetch(a,{method:"POST",headers:{Authorization:e}});if(!o.ok)throw new Error(o.statusText);return await o.json()},delete:async()=>{const a=new URL("/api/v1/auth/apitoken",t),o=await fetch(a,{method:"DELETE",headers:{Authorization:e}});if(!o.ok)throw new Error(o.statusText)}});