mirror of
https://github.com/3lLobo/zkAuth.git
synced 2026-01-10 04:47:56 -05:00
comments
This commit is contained in:
@@ -14,7 +14,7 @@ const uriSuffix = '&issuer=zkAuth'
|
||||
/**
|
||||
* Prepares Merkle Tree of hashes of [time, OTP(time)] and stores it on storage
|
||||
*
|
||||
* @returns an array containing the uri of TOTP, the secret of the TOTP and the root of the merkle tree
|
||||
* @returns an array containing the uri of TOTP, the secret of the TOTP, the root of the merkle tree and the encrypted hashes
|
||||
*/
|
||||
export async function prepareMerkleTree() {
|
||||
const SECRET = prepareSecret()
|
||||
@@ -56,6 +56,7 @@ export async function prepareMerkleTree() {
|
||||
* Generates inputs for on Chain OTP verification.
|
||||
*
|
||||
* @param otp - The otp entered by the user to verify
|
||||
* @param encryptedHashes - the user specific encrypted hashes
|
||||
* @returns a formatted object ready to use with contract verification
|
||||
*/
|
||||
export async function generateInput(otp: string | number, encryptedHashes: string) {
|
||||
@@ -162,8 +163,6 @@ export async function encryptMetamask(data: string): Promise<string | undefined>
|
||||
method: 'eth_getEncryptionPublicKey',
|
||||
params: [from[0]],
|
||||
})
|
||||
console.log("🚀 ~ file: utils.ts ~ line 157 ~ encryptMetamask ~ encryptionPublicKey", encryptionPublicKey, data)
|
||||
|
||||
if (encryptionPublicKey) {
|
||||
|
||||
const encryptedData = await encrypt(
|
||||
|
||||
@@ -14,7 +14,7 @@ async function connectCeramic({ address, connect, setConnecting }: { address: st
|
||||
})
|
||||
}
|
||||
|
||||
// A hook combining login and fetching data. Gets trigered when a eth address is passed.
|
||||
// A hook combining login and fetching data. Gets triggered when a eth address is passed.
|
||||
export function useCeramic(address: string | null): {
|
||||
ceramicData: ViewerRecord<any>,
|
||||
ceramicStatus: string
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
"autoprefixer": "^10.4.8",
|
||||
"eslint": "8.23.0",
|
||||
"eslint-config-next": "12.3.0",
|
||||
"graphql": "16.1.0",
|
||||
"graphql": "^16.6.0",
|
||||
"postcss": "^8.4.16",
|
||||
"postcss-import": "^15.0.0",
|
||||
"prettier": "^2.7.1",
|
||||
|
||||
@@ -20,6 +20,12 @@ function demoEncryption() {
|
||||
}
|
||||
console.log("Record: ", ceramicData)
|
||||
console.log("ceramicStatus", ceramicStatus)
|
||||
|
||||
// @danial How to read the data
|
||||
if (ceramicData.content) {
|
||||
console.log("Read the hashes: ", ceramicData.content.MerkleTree)
|
||||
}
|
||||
|
||||
}, [ceramicData, ceramicStatus])
|
||||
|
||||
const topSecret = "TopSecret🔐"
|
||||
|
||||
1729
dapp/yarn.lock
1729
dapp/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user