Skip to content

[grid] fix Global Account frontend auth sample#563

Merged
DhruvPareek merged 1 commit into
mainfrom
dp/fix-global-account-frontend-auth-sample
Jun 10, 2026
Merged

[grid] fix Global Account frontend auth sample#563
DhruvPareek merged 1 commit into
mainfrom
dp/fix-global-account-frontend-auth-sample

Conversation

@DhruvPareek

@DhruvPareek DhruvPareek commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • UTF-8 encode the Grid passkey reauth challenge before passing it to navigator.credentials.get(), instead of base64url-decoding it.
  • Build Grid-Wallet-Signature as the Turnkey API-key stamp shape Grid expects: base64url JSON with publicKey, scheme, and DER signature hex.
  • Remove the obsolete raw base64 signature helper from the sample.

Validation

  • npm run build in samples/frontend
  • make build at the stack tip

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Jun 10, 2026 5:08pm

Request Review

@greptile-apps

greptile-apps Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes two correctness issues in the Global Account frontend authentication sample for the real (non-sandbox) passkey reauth flow.

  • Challenge encoding: replaces base64urlToBytes(challenge.challenge) with new TextEncoder().encode(challenge.challenge), aligning with how Grid's /challenge endpoint actually sends the challenge string.
  • Wallet signature format: replaces the old raw base64-encoded DER signature with a Turnkey API-key stamp — base64url-encoded JSON containing publicKey, scheme, and signature — matching what Grid's Grid-Wallet-Signature header expects.
  • Removes the now-unused base64urlToBytes and bytesToBase64 helpers.

Confidence Score: 5/5

Safe to merge — both changes are correctness fixes to the production signing path in a sample file, and the sandbox path (the default) is untouched.

The two changes (challenge encoding and stamp format) are targeted and internally consistent. The removed helpers are genuinely unused after the change, and the remaining utility functions are still present and used correctly.

No files require special attention.

Important Files Changed

Filename Overview
samples/frontend/src/steps/embeddedWallet/AuthenticateAndSign.tsx Fixes WebAuthn challenge encoding and replaces raw base64 DER signature output with a Turnkey API-key stamp; removes two now-unused helpers. Changes are self-consistent and sandbox path is unaffected.

Reviews (2): Last reviewed commit: "[grid] fix Global Account frontend auth ..." | Re-trigger Greptile

@DhruvPareek DhruvPareek changed the base branch from dp/clarify-email-otp-registration-bundle-docs to graphite-base/563 June 10, 2026 17:07
@DhruvPareek DhruvPareek force-pushed the dp/fix-global-account-frontend-auth-sample branch from 6a21cc1 to 50c9215 Compare June 10, 2026 17:07
@graphite-app graphite-app Bot changed the base branch from graphite-base/563 to main June 10, 2026 17:08
@DhruvPareek DhruvPareek force-pushed the dp/fix-global-account-frontend-auth-sample branch from 50c9215 to 060c68b Compare June 10, 2026 17:08
@DhruvPareek DhruvPareek merged commit 46611d1 into main Jun 10, 2026
9 checks passed

Copy link
Copy Markdown
Contributor Author

Merge activity

@DhruvPareek DhruvPareek deleted the dp/fix-global-account-frontend-auth-sample branch June 10, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants