From a28cc02b7b0abb23d0c8ab032d233d57a09c1014 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Mon, 15 Jan 2024 16:46:38 +0530 Subject: [PATCH] Improved: handling of login of flow(#14) --- src/api/index.ts | 5 +++-- src/store/modules/user/actions.ts | 1 - src/views/BrokeringRuns.vue | 4 ++-- src/views/Login.vue | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 8a409d0..0c6076a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,10 +7,11 @@ import { StatusCodes } from "http-status-codes"; import router from "@/router" axios.interceptors.request.use((config: any) => { + // TODO: pass csrf token const token = store.getters["user/getUserToken"]; if (token) { - config.headers.Authorization = "Bearer " + token; - config.headers["Content-Type"] = "application/x-www-form-urlencoded"; + config.headers["api_key"] = token; + config.headers["Content-Type"] = "application/json"; } return config; diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index c5a2f04..d39d991 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -36,7 +36,6 @@ const actions: ActionTree = { console.error("error", err); return Promise.reject(new Error(err)) } - // return resp }, /** diff --git a/src/views/BrokeringRuns.vue b/src/views/BrokeringRuns.vue index 471b41c..b9f6c33 100644 --- a/src/views/BrokeringRuns.vue +++ b/src/views/BrokeringRuns.vue @@ -26,8 +26,8 @@ {{ "Description" }} - {{ "" }} - {{ "" }} + {{ "" }} + {{ "" }} {{ "Created at