nav fixes
This commit is contained in:
parent
e6c648f4fb
commit
bb6a9d39dd
|
@ -12,6 +12,8 @@ const loginInterrupt = function(current_url, message) {
|
||||||
if(!current_url.includes("gate/sign-in"))
|
if(!current_url.includes("gate/sign-in"))
|
||||||
sessionStorage.crinterrupted_page = current_url;
|
sessionStorage.crinterrupted_page = current_url;
|
||||||
sessionStorage.crinterrupt_message = message;
|
sessionStorage.crinterrupt_message = message;
|
||||||
|
|
||||||
|
if(!current_url.includes("gate/sign-in"))
|
||||||
window.location.href = loginUrl;
|
window.location.href = loginUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,8 +66,11 @@ export const auth = {
|
||||||
},
|
},
|
||||||
login: async({ commit, state, dispatch }) => {
|
login: async({ commit, state, dispatch }) => {
|
||||||
try {
|
try {
|
||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
commit('inProgress', true);
|
commit('inProgress', true);
|
||||||
const token = await doLogin(state.one);
|
const token = await doLogin(state.one);
|
||||||
|
|
||||||
if (token) {
|
if (token) {
|
||||||
commit('loginSuccess', {token:token,logged:state.one.logged});
|
commit('loginSuccess', {token:token,logged:state.one.logged});
|
||||||
dispatch('userCartProduct/checkUserToken', {}, { root: true });
|
dispatch('userCartProduct/checkUserToken', {}, { root: true });
|
||||||
|
@ -80,6 +83,11 @@ export const auth = {
|
||||||
redirectToInterruptedPage();
|
redirectToInterruptedPage();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
commit('loginFailure', "Email id or password is incorrect");
|
||||||
|
commit('inProgress', false);
|
||||||
|
}
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
commit('inProgress', false);
|
commit('inProgress', false);
|
||||||
commit('prepareWithMessage');
|
commit('prepareWithMessage');
|
||||||
|
|
Loading…
Reference in New Issue