From 59377a34680fccd64e4f905356ce4355386a5c3a Mon Sep 17 00:00:00 2001 From: mandalore Date: Fri, 4 Sep 2026 19:38:12 -0500 Subject: [PATCH] Strip leading "Bearer " when saving the BCP auth token DevTools' "Copy value" on the authorization header includes the "Bearer " prefix, so accept and normalize it instead of requiring users to trim it. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01MRS5Lvcig4TNpPyviUooGa --- sites/scouting/index.html | 2 +- sites/scouting/src/main.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sites/scouting/index.html b/sites/scouting/index.html index b9b4e12..8883915 100644 --- a/sites/scouting/index.html +++ b/sites/scouting/index.html @@ -72,7 +72,7 @@
  • Open your browser's developer tools (F12, or right-click → Inspect) and switch to the Network tab.
  • Back on BCP, open any event or your profile so the page makes a new request — refreshing the page works.
  • In the Network tab, click any request to newprod-api.bestcoastpairings.com.
  • -
  • Find the authorization request header. Copy everything after Bearer — that's your token.
  • +
  • Find the authorization request header and copy its value (pasting the whole thing, including the leading "Bearer ", is fine).
  • Paste it into the field above and click Save.
  • diff --git a/sites/scouting/src/main.js b/sites/scouting/src/main.js index f01a7dd..d82712c 100644 --- a/sites/scouting/src/main.js +++ b/sites/scouting/src/main.js @@ -144,7 +144,10 @@ async function loadItcRanks(userIds) { never committed, never part of the deployed bundle. */ const TOKEN_KEY = "bcp_auth_token"; const getToken = () => { try { return localStorage.getItem(TOKEN_KEY) || ""; } catch { return ""; } }; -const setToken = t => { try { t ? localStorage.setItem(TOKEN_KEY, t) : localStorage.removeItem(TOKEN_KEY); } catch {} }; +const setToken = t => { + t = t.replace(/^bearer\s+/i, ""); + try { t ? localStorage.setItem(TOKEN_KEY, t) : localStorage.removeItem(TOKEN_KEY); } catch {} +}; // This event tracks the five ITC-standard mission dispositions. Hand-typed // sources (a "Dispositions Used:" line in a submitted list, BCP's own free @@ -829,6 +832,7 @@ $("disposition-toggle").addEventListener("click", () => { $("bcp-token-input").value = getToken(); $("bcp-token-save").addEventListener("click", () => { setToken($("bcp-token-input").value.trim()); + $("bcp-token-input").value = getToken(); if (state) startBackfill(state.event); }); $("bcp-token-clear").addEventListener("click", () => {