v0.3.12-beta: herstel sessie na refresh (regressie beveiligingsaudit)
All checks were successful
dev - build & deploy naar test / build-and-deploy (push) Successful in 27s
All checks were successful
dev - build & deploy naar test / build-and-deploy (push) Successful in 27s
De beveiligingsaudit (v0.3.03-beta) verving de client-side Bearer-token (localStorage) door een HttpOnly session-cookie, maar de sessie-herstel-IIFE in app.js las nog steeds de verwijderde TOKEN-variabele uit - een ReferenceError die de hele boot-restore liet crashen. Resultaat: elke paginaverversing verloor de ingelogde staat, ook al bleef de cookie zelf geldig. Fix: geen client-side tokencheck meer nodig (de HttpOnly-cookie is sowieso niet leesbaar door JS en gaat vanzelf mee); /auth/me wordt nu altijd geprobeerd en valt bij een 401 terug op gastmodus.
This commit is contained in:
parent
aac7fd1c68
commit
be89a7b498
3 changed files with 5 additions and 4 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
0.3.11-beta
|
0.3.12-beta
|
||||||
|
|
|
||||||
|
|
@ -79,10 +79,11 @@ try{
|
||||||
|
|
||||||
applyI18n();
|
applyI18n();
|
||||||
updateEmptyHint();
|
updateEmptyHint();
|
||||||
/* sessie herstellen: geldig servertoken? dan opnieuw inloggen zonder wachtwoord */
|
/* sessie herstellen: de HttpOnly session-cookie (niet leesbaar door JS, dus
|
||||||
|
geen client-side token-check meer mogelijk of nodig) gaat vanzelf mee met
|
||||||
|
dit verzoek - een geldige sessie levert de gebruiker op, anders 401 (gast) */
|
||||||
(async function(){
|
(async function(){
|
||||||
updateBoardsUI();
|
updateBoardsUI();
|
||||||
if(!TOKEN) return;
|
|
||||||
try{
|
try{
|
||||||
const me = await api("/auth/me");
|
const me = await api("/auth/me");
|
||||||
currentUser = me.user;
|
currentUser = me.user;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
/* version — shown until /api/version resolves (or if the fetch fails, e.g. offline).
|
/* version — shown until /api/version resolves (or if the fetch fails, e.g. offline).
|
||||||
Kept in sync by hand with the VERSION file at the repo root on every release. */
|
Kept in sync by hand with the VERSION file at the repo root on every release. */
|
||||||
const VERSION = "0.3.11-beta";
|
const VERSION = "0.3.12-beta";
|
||||||
(function(){
|
(function(){
|
||||||
const tag = document.getElementById("verTag");
|
const tag = document.getElementById("verTag");
|
||||||
tag.textContent = "v"+VERSION;
|
tag.textContent = "v"+VERSION;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue