Skip to content

[#675] Return members to their form after Discord sign-in - #676

Merged
DVidal1205 merged 1 commit into
mainfrom
blade/form-signin-return
Dec 3, 2026
Merged

DVidal1205 merged 1 commit into
mainfrom
blade/form-signin-return

Conversation

@Kevinli7673

Copy link
Copy Markdown
Contributor

Why

Opening a shared RSVP link while signed out sent the member to the Blade homepage. They had to find the link again after signing in.

Closes #675

What changed

The form page now sends guests through the existing Discord sign-in route with the form path as its callback. Links with a responseId return to that specific response. Signed-in members continue directly to the form.

Test plan

  • 141 tests passed across the Blade forms suite and member events sign-in tests. The new route tests cover a plain form link, a response-specific link, and signed-in access.
  • pnpm verify:precommit passed, including React analysis, formatting, lint (with warnings), and typechecking.
  • Forge quick review completed before submission. The redirect was tested locally with mocked sign-in. Live Discord OAuth was not exercised.

Checklist

  • Database schema and migrations are unchanged.
  • Environment variables are unchanged.

Co-authored-by: Codex <codex@openai.com>
@Kevinli7673 Kevinli7673 added Blade Change modifies code in Blade app Bug Something isn't working labels Dec 3, 2026
@Kevinli7673 Kevinli7673 self-assigned this Dec 3, 2026
@coderabbitai

coderabbitai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When no session exists, the form page redirects to Discord sign-in with a callback to the requested form. The callback preserves the form slug and optional responseId. Tests cover signed-out redirects and signed-in response loading.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to d8e4b

Signed-out members who open a shared form link should return to that form, or to the same response, after Discord sign-in. Signed-in members still go straight to the form. No remaining merge-blocking risk was found.

Pre-merge checks: Passed 7

Check name Status Explanation
Title check Passed Title starts with issue number in brackets, is 57 characters, and describes the change: returning members to their form after Discord sign-in. Meets the required format.
Description check Passed Description explains the signed-out redirect problem, the change to route through the existing Discord sign-in with the form path as callback, responseId handling, and the test plan. It relates direct…
Linked Issues check Passed [#675] Signed-out access to /form/[slug] now redirects to /api/auth/signin?provider=discord&callbackURL=... (apps/blade/src/app/form/[slug]/page.tsx). The callback is /form/{slug}, with `respons…
Out of Scope Changes check Passed The whole-PR diff against the merge base changes only the signed-out branch of FormPage (+9/-1) and adds a test file for the same paths. Both changes serve #675. No unrelated changes were identified…
No Hardcoded Secrets Passed The PR changes two files: apps/blade/src/app/form/[slug]/page.tsx (modified) and apps/blade/src/tests/forms/form-page-signin.test.ts (added). Reviewing the full diff, no API keys, passwords, tokens, o…
Validated Env Access Passed The PR changes two files: apps/blade/src/app/form/[slug]/page.tsx (modified) and apps/blade/src/tests/forms/form-page-signin.test.ts (added). The diff for the PR adds no process.env access. The …
No Typescript Escape Hatches Passed The PR adds lines in two files: apps/blade/src/app/form/[slug]/page.tsx and apps/blade/src/tests/forms/form-page-signin.test.ts. I searched every added line in the diff against `refs/coderabbit/pr…
Full details: Description check

Explanation

Description explains the signed-out redirect problem, the change to route through the existing Discord sign-in with the form path as callback, responseId handling, and the test plan. It relates directly to the changeset.

Full details: Linked Issues check

Explanation

[#675] Signed-out access to /form/[slug] now redirects to /api/auth/signin?provider=discord&amp;callbackURL=... (apps/blade/src/app/form/[slug]/page.tsx). The callback is /form/{slug}, with responseId appended and encoded when present. This meets the expected behavior for plain links and response-specific links. The signin route exists at apps/blade/src/app/api/auth/signin/route.ts and reads provider and callbackURL. Signed-in users skip the redirect and continue to the form, as before. The summary reports new route tests (apps/blade/src/tests/forms/form-page-signin.test.ts) covering these cases. Live Discord OAuth was not exercised, and the non-E2E signInRoute callback handling was not inspected.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base changes only the signed-out branch of FormPage (+9/-1) and adds a test file for the same paths. Both changes serve #675. No unrelated changes were identified. The PR description states that schema, migrations, and environment variables are unchanged.

Full details: No Hardcoded Secrets

Explanation

The PR changes two files: apps/blade/src/app/form/[slug]/page.tsx (modified) and apps/blade/src/tests/forms/form-page-signin.test.ts (added). Reviewing the full diff, no API keys, passwords, tokens, or secrets appear as string literals. A case-insensitive search of the diff for api key, secret, passw, token, sk-, ghp_, bearer, and private key found no matches. The redirect builds its URL from the slug, responseId, and a provider name ("discord") with no credentials. The test file uses placeholder UUIDs (00000000-0000-4000-8000-000000000001) and mock values, which are not secrets. Provider-reported PR #676 author is Kevinli7673.

Full details: Validated Env Access

Explanation

The PR changes two files: apps/blade/src/app/form/[slug]/page.tsx (modified) and apps/blade/src/tests/forms/form-page-signin.test.ts (added). The diff for the PR adds no process.env access. The page change only swaps the redirect("/") for a redirect to /api/auth/signin?provider=discord&amp;callbackURL=..., and it builds the callback URL from slug and responseId. A search of both changed files for process.env returned no matches. The check therefore has no violation to flag.

Full details: No Typescript Escape Hatches

Explanation

The PR adds lines in two files: apps/blade/src/app/form/[slug]/page.tsx and apps/blade/src/tests/forms/form-page-signin.test.ts. I searched every added line in the diff against refs/coderabbit/pre-merge-check/base..head for any (including as any and &lt;any&gt;), @ts-ignore, @ts-expect-error, @ts-nocheck, and non-null assertions (!., ![, !), and similar). No matches were found. The only ! token in the added lines is if (!session), which is boolean negation and not a non-null assertion. The test file types its mocks through vi.fn and vi.hoisted without any. The check passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/blade/src/app/form/[slug]/page.tsx

ESLint execution timed out; analysis is incomplete

apps/blade/src/tests/forms/form-page-signin.test.ts

ESLint skipped: the matched ESLint configuration already failed (timeout).

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2493690 and d8e4bda.

Files selected for processing: 2

  • apps/blade/src/app/form/[slug]/page.tsx
  • apps/blade/src/tests/forms/form-page-signin.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@DVidal1205 DVidal1205 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonderful

@DVidal1205
DVidal1205 added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 99a1e69 Dec 3, 2026
14 checks passed
@DVidal1205
DVidal1205 deleted the blade/form-signin-return branch December 3, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Blade Change modifies code in Blade app Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return members to the form they opened after Discord sign-in

2 participants