From 7f77ad39bf3db80eec43ad947f07771ab7d9fdc3 Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Mon, 10 Mar 2025 14:17:24 +0700 Subject: [PATCH] Update login.js to use Bearer on header --- static/js/auth/login.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/static/js/auth/login.js b/static/js/auth/login.js index e37efe0..a3f53e9 100644 --- a/static/js/auth/login.js +++ b/static/js/auth/login.js @@ -32,16 +32,14 @@ function responseSession(response) { function setSession(jwt) { var url = "/api/auth/session/set"; - var payload = { - "jwt" : jwt - }; + var payload = {}; sendHttpRequest(url, "POST", payload, function (error, response) { if (error) console.error("Error:", error); else { console.log("JSON Response:", response); responseSession(response); } - }, "application/json"); + }, "application/json", `Bearer ${jwt}`); } function responseAlert(response) {