This commit is contained in:
@@ -4,11 +4,22 @@ import initialize from "./initialize";
|
||||
|
||||
export function processLogin(response) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
//check there is a response of some kind
|
||||
if (!response) {
|
||||
window.$gz.store.commit("logItem", "auth::processLogin -> no response");
|
||||
return reject();
|
||||
}
|
||||
|
||||
//is there an error?
|
||||
if (response.error) {
|
||||
return reject(response.error);
|
||||
}
|
||||
|
||||
//is token present?
|
||||
if (!response || !response.data || !response.data.token) {
|
||||
if (!response.data || !response.data.token) {
|
||||
window.$gz.store.commit(
|
||||
"logItem",
|
||||
"auth::processLogin -> response empty"
|
||||
"auth::processLogin -> response contains no data"
|
||||
);
|
||||
return reject();
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ export default {
|
||||
)
|
||||
.then(window.$gz.api.status)
|
||||
.then(window.$gz.api.json)
|
||||
// eslint-disable-next-line
|
||||
.then((response) => {
|
||||
window.$gz._.forEach(
|
||||
response.data,
|
||||
|
||||
Reference in New Issue
Block a user