-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
058d4c7
commit 16fb05c
Showing
2 changed files
with
19 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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-7pvrc-mei7e-9u3pfedu9tidiq6p', | ||
// baseUrl: 'https://app.dfns.ninja/', | ||
// signer: new WebAuthnSigner(), | ||
// }); | ||
|
||
const { token } = await dfnsAuth.login({ | ||
username: '[email protected]', | ||
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, | ||
|