|
86 | 86 | publish: "community/publish.html", |
87 | 87 | support: "docs/support.html", |
88 | 88 | reference: "docs/reference.html", |
89 | | - login: "login.html", |
| 89 | + "sign-in": "account/sign-in.html", |
90 | 90 | contact: "company/contact.html", |
91 | 91 | vision: "company/vision.html", |
92 | 92 | mission: "company/mission.html", |
|
139 | 139 |
|
140 | 140 | const currentScript = document.currentScript || document.querySelector("script[src*='gamefoundry-partials.js']"); |
141 | 141 | const assetRoot = currentScript ? new URL("../", currentScript.src) : null; |
142 | | - const apiBackedLoginDiagnostic = "Use the API-backed local server for login. Run npm run dev:local-api and open http://127.0.0.1:5501/login.html."; |
| 142 | + const apiBackedLoginDiagnostic = "Use the API-backed local server for sign-in. Run npm run dev:local-api and open http://127.0.0.1:5501/account/sign-in.html."; |
143 | 143 | let navigationAdminMenuCache = null; |
144 | 144 |
|
145 | 145 | function assetUrl(path) { |
|
348 | 348 | return { |
349 | 349 | authenticated: false, |
350 | 350 | diagnostic: diagnostic || "Server session API is unavailable. Start the local server API before using protected pages.", |
351 | | - displayName: "Login", |
| 351 | + displayName: "Sign In", |
352 | 352 | mode: "missing-api", |
353 | 353 | roleSlugs: [] |
354 | 354 | }; |
|
384 | 384 | return { |
385 | 385 | authenticated: Boolean(session.authenticated), |
386 | 386 | diagnostic: session.diagnostic || "", |
387 | | - displayName: session.authenticated ? session.displayName || session.label || "Account" : "Login", |
| 387 | + displayName: session.authenticated ? session.displayName || session.label || "Account" : "Sign In", |
388 | 388 | mode: session.mode || "local-db", |
389 | 389 | roleSlugs: Array.isArray(session.roleSlugs) ? session.roleSlugs : [] |
390 | 390 | }; |
|
413 | 413 | const canUseAdmin = loginState.authenticated && loginState.roleSlugs.includes("admin"); |
414 | 414 |
|
415 | 415 | if (accountLink) { |
416 | | - accountLink.textContent = canUseAccount ? loginState.displayName + " \u25BE" : "Login"; |
417 | | - accountLink.setAttribute("aria-label", canUseAccount ? "Account menu for " + loginState.displayName : "Login"); |
418 | | - accountLink.setAttribute("href", canUseAccount ? routeHref("account") : routeHref("login")); |
| 416 | + accountLink.textContent = canUseAccount ? loginState.displayName + " \u25BE" : "Sign In"; |
| 417 | + accountLink.setAttribute("aria-label", canUseAccount ? "Account menu for " + loginState.displayName : "Sign In"); |
| 418 | + accountLink.setAttribute("href", canUseAccount ? routeHref("account") : routeHref("sign-in")); |
419 | 419 | } |
420 | 420 | if (accountMenu) { |
421 | 421 | accountMenu.hidden = !canUseAccount; |
|
432 | 432 | return { |
433 | 433 | role: "admin", |
434 | 434 | title: "Admin role required", |
435 | | - message: "Log in as Admin to open this Admin page." |
| 435 | + message: "Sign in as Admin to open this Admin page." |
436 | 436 | }; |
437 | 437 | } |
| 438 | + if (pagePath === "account/sign-in.html") { |
| 439 | + return null; |
| 440 | + } |
438 | 441 | if (pagePath.indexOf("account/") === 0) { |
439 | 442 | return { |
440 | 443 | role: "user", |
441 | | - title: "Login required", |
442 | | - message: "Log in as a local user to open Account pages." |
| 444 | + title: "Sign-in required", |
| 445 | + message: "Sign in as a local user to open Account pages." |
443 | 446 | }; |
444 | 447 | } |
445 | 448 | return null; |
|
491 | 494 | status.dataset.sessionAccessStatus = ""; |
492 | 495 | status.textContent = [ |
493 | 496 | `Blocked ${pagePath}. Current session: ${loginState.displayName}.`, |
494 | | - loginState.diagnostic ? `Login/session diagnostic: ${loginState.diagnostic}` : "" |
| 497 | + loginState.diagnostic ? `Sign-in/session diagnostic: ${loginState.diagnostic}` : "" |
495 | 498 | ].filter(Boolean).join(" "); |
496 | 499 | const link = document.createElement("a"); |
497 | 500 | link.className = "btn primary"; |
498 | | - link.href = routeHref("login") + "?returnTo=" + encodeURIComponent(pagePath); |
499 | | - link.textContent = "Open Login"; |
| 501 | + link.href = routeHref("sign-in") + "?returnTo=" + encodeURIComponent(pagePath); |
| 502 | + link.textContent = "Open Sign In"; |
500 | 503 | body.append(status, link); |
501 | 504 | card.append(body); |
502 | 505 | bodyContainer.append(card); |
|
0 commit comments