diff --git a/.gitignore b/.gitignore index a0dddc6..e5e096b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ yarn-error.log* *.njsproj *.sln *.sw? + +.env diff --git a/now.json b/now.json new file mode 100644 index 0000000..447bef9 --- /dev/null +++ b/now.json @@ -0,0 +1,8 @@ +{ + "routes": [ + { + "src": "/api/(.*)", + "dest": "https://openrank.herokuapp.com/api/$1" + } + ] +} diff --git a/src/store/modules/authentication/login.js b/src/store/modules/authentication/login.js index c7a1c08..2bb3e7b 100644 --- a/src/store/modules/authentication/login.js +++ b/src/store/modules/authentication/login.js @@ -37,14 +37,13 @@ export default { email, password, }).then(({ data: { data: { token }, message } }) => { - console.log('TOKEN', token); commit('authentication/user/setToken', token, { root: true }); commit('setSuccessMsg', message); + setTimeout(() => commit('setSuccessMsg', null), 2000); router.push('/').catch(() => {}); }).catch(({ response }) => { - console.log('CAME HERE'); commit('setErrorMsg', rootGetters.getErrorMessage(response)); - console.log(response); + setTimeout(() => commit('setErrorMsg', null), 2000); }); }, }, diff --git a/src/store/modules/authentication/register.js b/src/store/modules/authentication/register.js index 46837bf..a73b5cd 100644 --- a/src/store/modules/authentication/register.js +++ b/src/store/modules/authentication/register.js @@ -50,9 +50,10 @@ export default { password_confirmed, }).then(({ data: { message } }) => { commit('setSuccessMsg', message); + setTimeout(() => commit('setSuccessMsg', null), 2000); }).catch(({ response }) => { commit('setErrorMsg', rootGetters.getErrorMessage(response)); - console.log(response); + setTimeout(() => commit('setErrorMsg', null), 2000); }); }, }, diff --git a/src/store/modules/authentication/user.js b/src/store/modules/authentication/user.js index 6e4ac02..658b878 100644 --- a/src/store/modules/authentication/user.js +++ b/src/store/modules/authentication/user.js @@ -58,9 +58,10 @@ export default { commit('setName', name); commit('setEmail', email); commit('setSuccessMsg', message); + setTimeout(() => commit('setSuccessMsg', null), 2000); }).catch(({ response }) => { commit('setErrorMsg', rootGetters.getErrorMessage(response)); - console.log(response); + setTimeout(() => commit('setErrorMsg', null), 2000); }); }, async updateUser({ @@ -88,9 +89,10 @@ export default { commit('setName', user.name); commit('setEmail', user.email); commit('setSuccessMSg', message); + setTimeout(() => commit('setSuccessMsg', null), 2000); }).catch(({ response }) => { commit('setErrorMsg', rootGetters.getErrorMessage(response)); - console.log(response); + setTimeout(() => commit('setErrorMsg', null), 2000); }); }, }, diff --git a/vue.config.js b/vue.config.js index 4091ee3..1739624 100644 --- a/vue.config.js +++ b/vue.config.js @@ -2,7 +2,9 @@ module.exports = { devServer: { proxy: { '/api': { - target: 'http://localhost:8000', + target: 'https://localhost:8000', + ws: true, + changeOrigin: true, headers: { Connection: 'keep-alive', },