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", () => {