From 106bf163cacfda112df4e517d2f3de8c1c8f5392 Mon Sep 17 00:00:00 2001 From: Monirzadeh <25131576+Monirzadeh@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:36:55 +0000 Subject: [PATCH] refactor: remove unneeded variable and unify the way send token in header (#763) --- internal/view/assets/js/page/setting.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/view/assets/js/page/setting.js b/internal/view/assets/js/page/setting.js index 209ded43b..cf4fc4dc9 100644 --- a/internal/view/assets/js/page/setting.js +++ b/internal/view/assets/js/page/setting.js @@ -83,7 +83,6 @@ export default { }, methods: { saveSetting() { - var authToken = JSON.parse(localStorage.getItem("shiori-token")); let options = { ShowId: this.appOptions.ShowId, ListMode: this.appOptions.ListMode, @@ -108,9 +107,10 @@ export default { body: JSON.stringify({ config: this.appOptions }), - headers: { "Content-Type": "application/json", - Authorization: `Bearer ${authToken}`, - }, + headers: { + 'Content-Type': 'application/json', + 'Authorization': 'Bearer ' + localStorage.getItem("shiori-token"), + } }).then(response => { if (!response.ok) throw response; return response.json();