Skip to content

Commit

Permalink
Merge pull request #272 from privacy-scaling-explorations/fix/nico/si…
Browse files Browse the repository at this point in the history
…we-observations

Fix/nico/siwe observations
  • Loading branch information
glamperd authored Mar 18, 2024
2 parents 671e653 + aa5707e commit b1c6fcc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/backend/src/functions/siwe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const checkNonceOfSIWEAddress = functions
const auth = getAuth()
// check nonce
const parts = result.sub.split("|")
const address = decodeURIComponent(parts[2]).split("eip155:534352:")[1]
const address = decodeURIComponent(parts[2]).split(":")[2]

const minimumNonce = Number(process.env.ETH_MINIMUM_NONCE)
const nonceBlockHeight = "latest" // process.env.ETH_NONCE_BLOCK_HEIGHT
Expand Down
10 changes: 6 additions & 4 deletions packages/phase2cli/src/commands/authSIWE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const showVerificationCodeAndUri = async (OAuthDeviceCode: OAuthDeviceCodeRespon
// Display data.
console.log(
`${theme.symbols.warning} Visit ${theme.text.bold(
theme.text.underlined(OAuthDeviceCode.verification_uri)
theme.text.underlined(OAuthDeviceCode.verification_uri_complete)
)} on this device to generate a new token and authenticate\n`
)
console.log(theme.colors.magenta(figlet.textSync("Code is Below", { font: "ANSI Shadow" })), "\n")
Expand All @@ -42,14 +42,16 @@ const showVerificationCodeAndUri = async (OAuthDeviceCode: OAuthDeviceCodeRespon
theme.symbols.success
}\n`
)
const spinner = customSpinner(`Redirecting to Github...`, `clock`)
const spinner = customSpinner(`Redirecting to Sign In With Ethereum...`, `clock`)
spinner.start()
await sleep(10000) // ~10s to make users able to read the CLI.
try {
// Automatically open the page (# Step 2).
await open(OAuthDeviceCode.verification_uri)
await open(OAuthDeviceCode.verification_uri_complete)
} catch (error: any) {
console.log(`${theme.symbols.info} Please authenticate via GitHub at ${OAuthDeviceCode.verification_uri}`)
console.log(
`${theme.symbols.info} Please authenticate via SIWE at ${OAuthDeviceCode.verification_uri_complete}`
)
}
spinner.stop()
}
Expand Down
2 changes: 2 additions & 0 deletions packages/phase2cli/src/commands/ceremony/listParticipants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const listParticipants = async () => {
const usersSnapshot = await getDocs(usersRef)
const users = usersSnapshot.docs.map((userDoc) => userDoc.data())
console.log(users) */

// TODO: finish this command by mergin the participants userId with the users real identifiers
} catch (err: any) {
showError(`Something went wrong: ${err.toString()}`, true)
}
Expand Down

0 comments on commit b1c6fcc

Please sign in to comment.