Add auth claim E2E flow#109
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Playwright Hosted Data-FlowOutcome: success This optional check runs the mutation-backed profile flow against a configured hosted dev/staging target with isolated E2E test data. |
Playwright Data-Flow PreviewOutcome: success Captured flow:
Artifacts include screenshots, traces, and recorded video for the flow run. |
Playwright Image DiffOutcome: success Changed screenshot baselines: none in this PR. This check compares public route screenshots against committed baselines. Inline images show only added or modified baseline PNGs. |
Playwright Public Screenshot PreviewOutcome: success Screenshots: all public route checks passed on desktop and mobile. Full screenshot set is available in the artifact. Pixel diff baselines are handled by the separate Playwright Image Diff check. |
Greptile SummaryThis PR wires up a full local auth/claim E2E path: it creates a
Confidence Score: 3/5The production auth path is unchanged; the risk is confined to the new local/staging E2E infrastructure. However, the The scripts/sync-convex-local-env.mjs (stdin input for Important Files Changed
Sequence DiagramsequenceDiagram
participant PW as Playwright test
participant API as Next.js /api/e2e/auth
participant CVX as Convex (public mutations)
participant INT as Convex (internal mutation)
participant UI as Browser / Next.js UI
PW->>API: POST /api/e2e/profile-submissions
API->>CVX: e2e.submitProfile(secret, …)
CVX-->>PW: "{ slug }"
PW->>UI: /sign-in → create account
UI->>CVX: signIn(password, signUp)
CVX->>INT: recordAuthCode(email, code, expiresAt)
PW->>API: "POST /api/e2e/auth { action:consume-code }"
API->>CVX: consumeAuthCode(secret, email)
CVX-->>PW: "{ code }"
PW->>UI: fill code → Verify email
UI->>CVX: signIn(password, email-verification)
CVX-->>UI: signingIn:true → /account
PW->>API: "POST /api/e2e/auth { action:link-discord }"
API->>CVX: linkDiscordAccountByEmail(secret, …)
PW->>UI: /account → Claim with Discord
UI->>CVX: claimPersonProfile(slug)
PW->>API: DELETE /api/e2e/profile-submissions
PW->>API: DELETE /api/e2e/auth
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
convex/auth.ts:65-71
Using `arguments[1]` to access the context object passed by `@convex-dev/auth`'s Email provider relies on the library calling `sendVerificationRequest(params, ctx)` — an undeclared second parameter. This coupling is invisible to TypeScript's type-checker and will silently break if the library ever changes the arity or argument order. Since `@convex-dev/auth` does officially pass a context as the second argument, simply declaring it as a named parameter is both correct and type-safe.
```suggestion
async sendVerificationRequest(
params,
ctx?: {
runMutation: (mutation: unknown, args: unknown) => Promise<unknown>;
},
) {
const { identifier, token, expires } = params;
```
### Issue 2 of 2
scripts/sync-convex-local-env.mjs:89-94
**`convex env set` stdin input is undocumented**
The command was changed from `["env", "set", name, value]` (positional arg) to `["env", "set", name]` with `input: value` (stdin). If the Convex CLI does not read the value from stdin for this sub-command, every env var in this list — including `JWT_PRIVATE_KEY` and `JWKS` — would either be set to an empty string or cause the command to fail, silently breaking local auth E2E runs. Can you confirm this is a supported invocation mode for the version of `convex` in use?
Reviews (1): Last reviewed commit: "Cover auth helper gate" | Re-trigger Greptile |
What changed
@e2e.vrdex.localpassword account, captures the OTP through token-gated helpers, links a Discord account, claims an E2E person profile, and verifies the public trust label.Why
Issue #100 needs signed-in claim coverage without relying on real SES or OAuth in local CI.
Verification
pnpm verify:backend:localpnpm --filter web lintpnpm --filter web typecheckpnpm typecheck:backendpnpm --filter web exec playwright test e2e/profile-submission.flow.spec.ts e2e/auth-claim.flow.spec.ts --project=desktop-chromiumpnpm test:e2epnpm test:backendRisk notes
VRDEX_ENABLE_E2E_AUTH_HELPERS=truein both Vercel staging and Convex dev.