From e080a1a7593e83a49d623ffdd452fd0e1c617889 Mon Sep 17 00:00:00 2001 From: Derick Montague Date: Wed, 4 Dec 2019 16:30:08 -0600 Subject: Add login and logout functionality - Add AuthenticationStore - Add ability to login and logout - Add route navigation guard - Add login styles - Add temporary authentication for api call - Add Login directory - Add index.js In order to login a .env.development.local file that contains BASE_URL="https:// or " Signed-off-by: Derick Montague Change-Id: I88b93e287e66f4bae82a1ec2934cdef12d78264e --- src/store/api.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/store/api.js') diff --git a/src/store/api.js b/src/store/api.js index d40ad0ad..39a6355c 100644 --- a/src/store/api.js +++ b/src/store/api.js @@ -2,15 +2,9 @@ import Axios from "axios"; const api = Axios.create(); -// TODO: this is a temporary workaround until -// authentication with login is working -const username = process.env.VUE_APP_USERNAME; -const password = process.env.VUE_APP_PASSWORD; -if (username && password) { - api.defaults.auth = {}; - api.defaults.auth.username = username; - api.defaults.auth.password = password; -} +// TODO: Permanent authentication solution +// Using defaults to set auth for sending +// auth object in header export default { get(path) { @@ -30,5 +24,6 @@ export default { }, all(promises) { return Axios.all(promises); - } + }, + defaults: api.defaults }; -- cgit v1.2.3