Skip to content

fix(SEC-P1-20261031): 共用 github.io origin 上停用 Supabase 登入 - #18

Merged
frobel0520 merged 2 commits into
devfrom
feature/17-shared-origin-auth-guard
Oct 31, 2026
Merged

frobel0520 merged 2 commits into
devfrom
feature/17-shared-origin-auth-guard

Conversation

@frobel0520

Copy link
Copy Markdown
Owner

Refs #17

問題

*.github.io 是帳號下所有 Pages 專案共用的 origin,Supabase Auth 會把登入 session 存在 localStorage,任一 Pages 站的腳本都讀得到。線上後端已於 2026-09-21 停用,目前沒有登入流量;風險在日後重建時。

修改

  • frontend/src/App.jsx、static/js/learn.js:在 *.github.io 上不建立 Supabase auth client,登入區塊顯示停用原因;其他網域不變。
  • deploy/github-supabase-deploy.md:重建前必讀,前端改放獨立網域(例如 *.pages.dev)。

驗證

  • vite build 通過、learn.js 語法檢查通過、Playwright smoke 5 項通過。
  • 以合成 Supabase 設定建置後模擬:frobel0520.github.io 顯示停用說明;*.pages.dev 顯示「使用 Google 登入」。

限制

  • 第二個 commit 只是把第一個 commit 誤改的 learn.js 換行(CRLF→LF)改回來;整體 diff 只剩 16 行實際修改。
  • 依 repo 流程先進 dev,再隨 dev → main 發布。

Generated by Claude Code

- React 前端與舊版 learn.js 在 *.github.io 上不建立 Supabase auth client,登入區塊與按鈕顯示停用原因;其他網域行為不變。
- deploy/github-supabase-deploy.md 開頭加上重建前必讀:前端改放獨立網域(例如 *.pages.dev),OAuth origin、Site URL 與 CORS_ORIGINS 改填該網域。
- 線上後端已於 2026-09-21 停用、目前沒有登入流量;本修改避免日後重建時把 session 存進共用 origin。

驗證:vite build 通過、learn.js 語法檢查通過、Playwright smoke 5 項通過;以合成 Supabase 設定建置後模擬 frobel0520.github.io 顯示停用說明、*.pages.dev 顯示「使用 Google 登入」。

Refs #17
- 上一個 commit 以腳本修改 learn.js 時把原本的 CRLF 換行轉成 LF,造成整檔差異;改回 CRLF,與 dev 的差異只剩停用登入的 4 行。

驗證:git diff origin/dev 只剩實際修改行;node --check 通過。

Refs #17
@frobel0520
frobel0520 merged commit 6aeb72c into dev Oct 31, 2026
3 checks passed
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.

1 participant