1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7157],{54773:(e,n,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_debug/webauthn",function(){return l(62940)}])},62940:(e,n,l)=>{"use strict";l.r(n),l.d(n,{default:()=>y});var a=l(80263),t=l(53239),i=l(60907),r=l(65969),s=l(60539),u=l(95707),o=l(80603),d=l(46563),c=l(85014),m=l(69932),p=l(31799),g=l(59245);let h=()=>{let e=(0,t.useContext)(p.A),[n,l,g]=(0,c.A)(),[h,y,k]=(0,m.A)();return(0,a.jsxs)(s.A,{maxWidth:"md",children:[(0,a.jsx)(d.A,{variant:"h4",gutterBottom:!0,children:"WebAuthn POC"}),(0,a.jsxs)(o.A,{container:!0,spacing:4,direction:"column",children:[(0,a.jsx)(o.A,{children:(0,a.jsxs)(i.A,{sx:{p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[(0,a.jsx)(d.A,{variant:"h6",gutterBottom:!0,children:"Link Passkey (Old API)"}),e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.A,{variant:"outlined",disabled:l.pending,onClick:()=>n(),children:l.pending?"Linkingâ¦":"Link Passkey"}),l.fulfilled&&(0,a.jsx)(d.A,{color:"success.main",sx:{mt:1},children:"Passkey linked successfully!"}),l.rejected&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.A,{color:"error",sx:{mt:1},children:"Link failed"}),(0,a.jsx)("pre",{children:JSON.stringify(l.error,null,2)})]}),(l.fulfilled||l.rejected)&&(0,a.jsx)(r.A,{size:"small",variant:"text",onClick:g,sx:{mt:1},children:"Reset"})]}):(0,a.jsx)(d.A,{color:"text.secondary",children:"You must be logged in to link a passkey."})]})}),(0,a.jsx)(u.A,{}),(0,a.jsx)(o.A,{children:(0,a.jsxs)(i.A,{sx:{p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[(0,a.jsx)(d.A,{variant:"h6",gutterBottom:!0,children:"Login with WebAuthn (New API)"}),(0,a.jsx)(r.A,{variant:"outlined",disabled:y.pending,onClick:()=>h(),children:y.pending?"Authenticatingâ¦":"Login with WebAuthn"}),y.fulfilled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.A,{color:"success.main",sx:{mt:1},children:"Login successful!"}),(0,a.jsxs)("pre",{children:["sessionId: ",y.value.sessionId]})]}),y.rejected&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.A,{color:"error",sx:{mt:1},children:"Login failed"}),(0,a.jsx)("pre",{children:JSON.stringify(y.error,null,2)})]}),(y.fulfilled||y.rejected)&&(0,a.jsx)(r.A,{size:"small",variant:"text",onClick:k,sx:{mt:1},children:"Reset"})]})}),(0,a.jsx)(o.A,{children:(0,a.jsxs)("pre",{children:["authenticated: ",JSON.stringify(e)]})})]})]})};h.PageLayout=g.Ay;let y=h},85014:(e,n,l)=>{"use strict";l.d(n,{A:()=>g});let a=function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],n={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"WebAuthnInitLinkPayload",kind:"LinkedField",name:"initLink",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"linkUid",storageKey:null},{alias:null,args:null,concreteType:"WebAuthnCreationOptions",kind:"LinkedField",name:"creationOptions",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"challenge",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"timeout",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"attestation",storageKey:null},{alias:null,args:null,concreteType:"WebAuthnCredentialParameters",kind:"LinkedField",name:"pubKeyCredParams",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"alg",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"WebAuthnRelyingParty",kind:"LinkedField",name:"relyingParty",plural:!1,selections:[n,l],storageKey:null},{alias:null,args:null,concreteType:"WebAuthnUser",kind:"LinkedField",name:"user",plural:!1,selections:[n,l,{alias:null,args:null,kind:"ScalarField",name:"displayName",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"useLinkWebAuthnInitMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"useLinkWebAuthnInitMutation",selections:a},params:{id:"34e93111c2231cf4f1f25d76a33608cf",metadata:{},name:"useLinkWebAuthnInitMutation",operationKind:"mutation",text:null}}}();a.hash="37dd02c07c0e77206673e36a051a6567";let t=function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}
1],n=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"WebAuthnCompleteLinkPayload",kind:"LinkedField",name:"completeLink",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"_",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"useLinkWebAuthnCompleteMutation",selections:n,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"useLinkWebAuthnCompleteMutation",selections:n},params:{id:"d270dfaa4c1e8d452bc36fdb1d72f810",metadata:{},name:"useLinkWebAuthnCompleteMutation",operationKind:"mutation",text:null}}}();t.hash="ab4fd939bead007b65d5de00519e09bb";var i=l(53239);l(62271);var r=l(45510),s=l(50732),u=l(81554),o=l(23780),d=l(10234),c=l(26054),m=l(37648),p=l(97918);function g(){let e=(0,i.useContext)(s.A);if(!e)throw new o.Pp("Operator needs to be defined for useLinkWebAuthn");let n=(0,i.useContext)(u.A),l=(0,c.A)();return(0,d.Ay)(async()=>{l({type:"initiated",flow:"link"});try{var i,s,u;let d,c=await (0,r.A)(n,{mutation:a,variables:{input:{operatorUid:e}}}),g=null==c?void 0:c.initLink;if(!g)throw new o.tF("No initLink mutation response");let{linkUid:h,creationOptions:y}=g,k=null!=(i=y.timeout)?i:6e4,f=(0,m.PG)({challenge:y.challenge,rp:{id:y.relyingParty.id,name:y.relyingParty.name},user:{id:y.user.id,name:y.user.name,displayName:y.user.displayName},pubKeyCredParams:null!=(s=y.pubKeyCredParams)?s:[],timeout:k,attestation:(null!=(u=y.attestation)?u:"NONE").toLowerCase(),authenticatorSelection:{authenticatorAttachment:"platform"}}),A=PublicKeyCredential;"function"==typeof A.signalAllAcceptedCredentials&&await A.signalAllAcceptedCredentials({rpId:y.relyingParty.id,userId:y.user.id,allAcceptedCredentialIds:[]}).catch(()=>{}),l({type:"prompted",flow:"link"});let b=new AbortController,x=!1,L=setTimeout(()=>{x=!0,b.abort()},Math.max(k-2e3,Math.ceil(k/2)));try{d=await navigator.credentials.create({publicKey:f,signal:b.signal})}catch(e){if(x)throw p.VL.of(p.AG.TIMEOUT,e);throw p.VL.from(e)}finally{clearTimeout(L)}if(!(d instanceof PublicKeyCredential)){if(x)throw p.VL.of(p.AG.TIMEOUT);throw new o.tF("credentials.create did not return a PublicKeyCredential")}let{response:{attestationObject:j,clientDataJSON:w}}=d.toJSON();l({type:"verifying",flow:"link"}),await (0,r.A)(n,{mutation:t,variables:{input:{linkUid:h,publicKeyCredential:{attestationObject:j,clientDataJSON:w}}}}),l({type:"success",flow:"link",authenticatorType:"platform"})}catch(n){let e=p.VL.from(n);throw(0,p.Vo)(n)?l({type:"cancelled",flow:"link"}):l({type:"failed",flow:"link",errorCode:e.code,context:e.context}),e}},p.AY)}}},e=>{e.O(0,[24149,4600,26042,59245,44950,69932,3643,90636,46593,38792],()=>e(e.s=54773)),_N_E=e.O()}]); 2//# sourceMappingURL=webauthn-975ba7a604208b4a.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.