mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-08 18:55:00 -04:00
Api refactoring fixes (#372)
* Fix JS error when logging in with bad credentials * Remove duplicate error message if bad credentials Error is already nicely displayed in LoginForm
This commit is contained in:
parent
1dc051f562
commit
d2e56cf233
@ -32,7 +32,7 @@ export const userAPI = {
|
|||||||
let response = await apiReq.post(
|
let response = await apiReq.post(
|
||||||
authURLs.token,
|
authURLs.token,
|
||||||
formData,
|
formData,
|
||||||
function() { return i18n.t('user.incorrect-username-or-password'); },
|
null,
|
||||||
function() { return i18n.t('user.user-successfully-logged-in'); }
|
function() { return i18n.t('user.user-successfully-logged-in'); }
|
||||||
);
|
);
|
||||||
return response;
|
return response;
|
||||||
|
@ -98,10 +98,9 @@ export default {
|
|||||||
this.clear();
|
this.clear();
|
||||||
this.$store.commit("setToken", response.data.access_token);
|
this.$store.commit("setToken", response.data.access_token);
|
||||||
this.$emit("logged-in");
|
this.$emit("logged-in");
|
||||||
}
|
|
||||||
|
|
||||||
let user = await api.users.self();
|
let user = await api.users.self();
|
||||||
this.$store.commit("setUserData", user);
|
this.$store.commit("setUserData", user);
|
||||||
|
}
|
||||||
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user