From 00c34f6d90d7f1709f1ee3cc557ac350edf2f80f Mon Sep 17 00:00:00 2001 From: samerbam Date: Thu, 24 Aug 2023 17:01:59 -0400 Subject: [PATCH] fix auth --- application/static/index.html | 4 ++-- application/static/scripts.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/application/static/index.html b/application/static/index.html index 9bb972f..91544f1 100644 --- a/application/static/index.html +++ b/application/static/index.html @@ -313,7 +313,7 @@ // }); // }); // import { createAuth0Client } from '@auth0/auth0-spa-js'; - let jToken = "" + const jToken = "" function loginAction(e) { auth0.createAuth0Client({ @@ -378,7 +378,7 @@ withCredentials: true, credentials: 'include', headers: { - 'Authorization': "Bearer " + t, + 'Authorization': "Bearer " + jToken, } }).then(re => { re.json().then(jso => { diff --git a/application/static/scripts.js b/application/static/scripts.js index 4b8cbe6..cf3c700 100644 --- a/application/static/scripts.js +++ b/application/static/scripts.js @@ -582,7 +582,8 @@ function sendPrintRequest(action, date, sentence="") { method: "post", headers: { 'Accept': 'application/json', - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', + 'Authorization': "Bearer " + jToken }, //make sure to serialize your JSON body