From 6ce1a07cd07b47b883e840fb34b081146bc92b6d Mon Sep 17 00:00:00 2001 From: Yoshie Muranaka Date: Fri, 6 Dec 2019 14:13:59 -0800 Subject: Add cookie based login authentication - Changed POST request data structure to match backend requirements for set-cookie in response header - Added withCredentials property to default axios config - Modifying proxied response to remove 'Secure' flag so browser can create Cookie while running locally - Add logout api request - Add js-cookie package to manage browser cookies - Update the babel preset config to include useBuiltIns, which resolves MIME type errors when overlaying - Disable vue-router history mode to use routher hash mode to resolves 404 errors when refreshing certain pages. This is expected behavior with history mode enabled. Server configuration changes are required to support HTML5 history mode: https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations Signed-off-by: Yoshie Muranaka Signed-off-by: Derick Montague Change-Id: I5d43f36ef546962474b6cc8fff89564f29048fde --- src/store/api.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/store/api.js') diff --git a/src/store/api.js b/src/store/api.js index 39a6355c..c50bcbee 100644 --- a/src/store/api.js +++ b/src/store/api.js @@ -1,6 +1,8 @@ import Axios from "axios"; -const api = Axios.create(); +const api = Axios.create({ + withCredentials: true +}); // TODO: Permanent authentication solution // Using defaults to set auth for sending -- cgit v1.2.3