[PR #32] [MERGED] Staff proxy: forward Origin so staff sign-in and setup links work #34

Closed
opened 2026-11-03 04:02:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon-site/pull/32
Author: @ludovic111
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/staff-proxy-origin


📝 Commits (1)

  • 4035568 Staff proxy: forward the browser's Origin to Kira

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 app/staff/api/[...path]/route.ts (+1 -1)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Since the Next.js rebuild (2a2b357) the /staff/api/* proxy no longer forwards the browser's Origin. Kira's staff API (src/staff-http.js) answers 403 "Wrong origin." to every POST without the site's Origin, so password setup links, sign-in, every dashboard write and the /apply form were all broken (a staff member reported the setup link).

Fix: add origin to the forwarded headers. The proxy already refuses cross-site writes (sameSite) before forwarding.

Tested locally against Kira's staff dev API (fake data): before, setup/peek → 403 "Wrong origin."; after, the setup link in headless Chromium sets the password and lands signed in on /staff/team; a POST with a foreign Origin is still refused (403).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon-site/pull/32 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/staff-proxy-origin` --- ### 📝 Commits (1) - [`4035568`](https://github.com/horizon-rust/horizon-site/commit/40355686b39f5df2a28bcaecef718ad4d1592876) Staff proxy: forward the browser's Origin to Kira ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `app/staff/api/[...path]/route.ts` (+1 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Since the Next.js rebuild (2a2b357) the `/staff/api/*` proxy no longer forwards the browser's `Origin`. Kira's staff API (`src/staff-http.js`) answers 403 "Wrong origin." to every POST without the site's Origin, so password setup links, sign-in, every dashboard write and the `/apply` form were all broken (a staff member reported the setup link). Fix: add `origin` to the forwarded headers. The proxy already refuses cross-site writes (`sameSite`) before forwarding. Tested locally against Kira's staff dev API (fake data): before, `setup/peek` → 403 "Wrong origin."; after, the setup link in headless Chromium sets the password and lands signed in on `/staff/team`; a POST with a foreign Origin is still refused (403). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:02:32 +07:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon-site#34
No description provided.