hash user id and app id

This commit is contained in:
Chris Cassano 2022-11-14 14:07:25 -08:00
parent 010b2fce10
commit 02a5ff37b7
4 changed files with 10 additions and 8 deletions

View File

@ -9,7 +9,7 @@
"@testing-library/user-event": "^13.5.0", "@testing-library/user-event": "^13.5.0",
"ethers": "^5.7.2", "ethers": "^5.7.2",
"js-base64": "^3.7.2", "js-base64": "^3.7.2",
"lit-js-sdk": "^1.2.31", "lit-js-sdk": "^1.2.32",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-scripts": "5.0.1", "react-scripts": "5.0.1",

View File

@ -55,7 +55,7 @@ function App() {
let jwtParts = credentialResponse.credential.split("."); let jwtParts = credentialResponse.credential.split(".");
let jwtPayload = JSON.parse(Base64.decode(jwtParts[1])); let jwtPayload = JSON.parse(Base64.decode(jwtParts[1]));
let idForAuthMethod = ethers.utils.hexlify( let idForAuthMethod = ethers.utils.keccak256(
ethers.utils.toUtf8Bytes(`${jwtPayload.sub}:${jwtPayload.aud}`) ethers.utils.toUtf8Bytes(`${jwtPayload.sub}:${jwtPayload.aud}`)
); );
@ -128,7 +128,9 @@ function App() {
}; };
// get the user a session with it // get the user a session with it
const litNodeClient = new LitJsSdk.LitNodeClient({ litNetwork: "serrano" }); const litNodeClient = new LitJsSdk.LitNodeClient({
litNetwork: "serrano",
});
await litNodeClient.connect(); await litNodeClient.connect();
const sessionSigs = await litNodeClient.getSessionSigs({ const sessionSigs = await litNodeClient.getSessionSigs({

View File

@ -15,4 +15,4 @@
"litNodeDomainName": "127.0.0.1", "litNodeDomainName": "127.0.0.1",
"litNodePort": 7470, "litNodePort": 7470,
"rocketPort": 7470 "rocketPort": 7470
} }

View File

@ -6884,10 +6884,10 @@ lit-connect-modal@^0.1.10:
dependencies: dependencies:
micromodal "^0.4.10" micromodal "^0.4.10"
lit-js-sdk@^1.2.31: lit-js-sdk@^1.2.32:
version "1.2.31" version "1.2.32"
resolved "https://registry.yarnpkg.com/lit-js-sdk/-/lit-js-sdk-1.2.31.tgz#6b78b8e705fd1fc9124cab2b122b7daba7550db7" resolved "https://registry.yarnpkg.com/lit-js-sdk/-/lit-js-sdk-1.2.32.tgz#334f26d5051acb6953b2e803860516859d19b78e"
integrity sha512-1KAEB+ZYJBSOIc8/j8al/C11DVH++MOuitJM/xsij+mJeupaNW0W7ZSTECxzEPnw3huPJPPrB/OSQfW+rON+BA== integrity sha512-UHM6J6sa+06EMMpjZkDtZ3hAQM4756m/ckRp3hSrmTMr5Qc3meISvlnPaH/BAPdwDdrgUMqmY+c1um4T+g7JCw==
dependencies: dependencies:
"@ethersproject/bytes" "^5.5.0" "@ethersproject/bytes" "^5.5.0"
"@ethersproject/contracts" "^5.2.0" "@ethersproject/contracts" "^5.2.0"