Tighten the remaining Cards and dev server security defaults
Session and OAuth cookies now carry the __Host- prefix over HTTPS, so another application of the domain cannot set them. The public configuration route has a request limit, the trader list reads every player in one query, and new campaign codes need eight characters while existing ones keep working. The Vite server now listens on 127.0.0.1 unless HOST says otherwise, because it gives administrator rights to any visitor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9b6da88ed3
commit
9ce0c3e33a
9 changed files with 137 additions and 43 deletions
|
|
@ -225,7 +225,7 @@ function CampaignForm({ catalog, lookup, campaigns, mutateCampaigns, busy, now,
|
|||
const expiry = draft.noExpiry ? null : new Date(draft.expiresAt).getTime();
|
||||
const code = draft.code.trim().toUpperCase();
|
||||
const limitReady = unlimited || (Number.isInteger(limit) && limit >= 1 && limit <= 100_000);
|
||||
const codeReady = /^[A-Z0-9][A-Z0-9-]{3,23}$/.test(code);
|
||||
const codeReady = /^[A-Z0-9][A-Z0-9-]{7,23}$/.test(code);
|
||||
const expiryReady = expiry === null || expiry > now;
|
||||
// Tout ce qui empêche la création, affiché sous le bouton pour ne jamais laisser un bouton désactivé sans explication.
|
||||
const missing = [
|
||||
|
|
@ -256,7 +256,7 @@ function CampaignForm({ catalog, lookup, campaigns, mutateCampaigns, busy, now,
|
|||
<div className="nebula-admin-campaign-identity">
|
||||
<label><span>Nom de la campagne, visible par les joueurs</span><input className="nds-input" value={draft.name} maxLength="80" placeholder="Ex. Live de lancement" onChange={(event) => update({ name: event.target.value })} required /></label>
|
||||
<div className="nebula-admin-code-field">
|
||||
<label><span>Code à annoncer (4 à 24 caractères)</span><input className="nds-input nebula-admin-code-input" value={draft.code} maxLength="24" placeholder="Ex. NEBULA-2026" onChange={(event) => update({ code: event.target.value.toUpperCase().replace(/\s+/g, "-").replace(/[^A-Z0-9-]/g, "") })} required /></label>
|
||||
<label><span>Code à annoncer (8 à 24 caractères)</span><input className="nds-input nebula-admin-code-input" value={draft.code} maxLength="24" placeholder="Ex. NEBULA-2026" onChange={(event) => update({ code: event.target.value.toUpperCase().replace(/\s+/g, "-").replace(/[^A-Z0-9-]/g, "") })} required /></label>
|
||||
<Tooltip as="button" className="nds-button" content="Générer un code aléatoire" data-variant="secondary" type="button" onClick={() => update({ code: randomCode(new Set(campaigns.map((campaign) => campaign.code))) })}>Générer</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue