diff --git a/src/app/hooks/use-dfns.ts b/src/app/hooks/use-dfns.ts index b55e1671..281ed922 100644 --- a/src/app/hooks/use-dfns.ts +++ b/src/app/hooks/use-dfns.ts @@ -1,28 +1,28 @@ -// import { DfnsAuthenticator } from '@dfns/sdk'; -// import { WebAuthnSigner } from '@dfns/sdk-browser'; +import { DfnsAuthenticator } from '@dfns/sdk'; +import { WebAuthnSigner } from '@dfns/sdk-browser'; export function useDFNS() { async function authenticateUser() { - const netlifyFunctionEndpoint = `/.netlify/functions/get-dfns-auth-token`; + // const netlifyFunctionEndpoint = `/.netlify/functions/get-dfns-auth-token`; - const response = await fetch(netlifyFunctionEndpoint); + // const response = await fetch(netlifyFunctionEndpoint); - console.log('response', response); - // const dfnsAuth = new DfnsAuthenticator({ - // appId: 'ap-7pvrc-mei7e-9u3pfedu9tidiq6p', - // baseUrl: 'https://app.dfns.ninja/', - // signer: new WebAuthnSigner(), - // }); + // console.log('response', response); + const dfnsAuth = new DfnsAuthenticator({ + appId: 'ap-6ao42-2e42m-9asohsp529h0sanm', + baseUrl: 'https://app.dfns.ninja', + signer: new WebAuthnSigner(), + }); - // const { token } = await dfnsAuth.login({ - // username: 'us-12nks-o4ogd-943qhq5l5020410m', - // orgId: 'or-4bcun-fj3tb-8np9ivfu5jnstkks', - // }); + const { token } = await dfnsAuth.login({ + username: 'us-12nks-o4ogd-943qhq5l5020410m', + orgId: 'or-4bcun-fj3tb-8np9ivfu5jnstkks', + }); - // console.log( - // 'tokeEEEEEEEEEEEEEEEEEEEEEEEEEEnEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE', - // token - // ); + console.log( + 'tokeEEEEEEEEEEEEEEEEEEEEEEEEEEnEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE', + token + ); } return { authenticateUser,