From 7d259ceef8eb2d84bc768332e63f0a2c3f0e160c Mon Sep 17 00:00:00 2001 From: rick Date: Thu, 9 Sep 2021 02:06:39 +0200 Subject: [PATCH] refactor: add ; --- static/gethash.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/static/gethash.js b/static/gethash.js index 62fa7a0..99e5685 100644 --- a/static/gethash.js +++ b/static/gethash.js @@ -1,13 +1,14 @@ -const hash = window.location.hash.substring(1).split('&') -var datas = {} +const hash = window.location.hash.substring(1).split('&'); +var datas = {}; for (let elem of hash) { - elem = elem.split('=') - datas[elem[0]] = elem[1] + elem = elem.split('='); + datas[elem[0]] = elem[1]; } + fetch('/mytoken', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(datas) -}).then(() => {window.location.replace("/")}) +}).then(() => {window.location.replace("/")});