Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/nico/siwe observations #272

Merged
merged 3 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading