From 8d8550a83532efb5cc5ebb513c174df5c2ef2449 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 23 Sep 2020 23:20:20 +0200 Subject: [PATCH] Fixed admin header not being set properly. Incorrectly used Boolean(). Now we check for the header value by string comparison, should always return boolean. --- src/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api.js b/src/api.js index 0becb00..05145b9 100644 --- a/src/api.js +++ b/src/api.js @@ -31,8 +31,8 @@ const allRequestedWines = () => { return fetch(url.href) .then(resp => { - const isAdmin = resp.headers.get("vinlottis-admin") || false; - return Promise.all([resp.json(), Boolean(isAdmin)]); + const isAdmin = resp.headers.get("vinlottis-admin") == "true"; + return Promise.all([resp.json(), isAdmin]); }); };