Skip to content

Commit

Permalink
fix login
Browse files Browse the repository at this point in the history
  • Loading branch information
Bixio999 committed Dec 24, 2019
1 parent a424b55 commit 58ae4e2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/DataProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,16 @@ class DataProvider {
};

return new Promise((resolve, reject) => {
this.doPost("/cliente/login", data)
this.doPost("/login", data)
.then(response => {
if (response.value != null) {
if (response.token != null) {
sessionStorage.setItem("token", response.value);
this.navigateCustomerHome();
if(response.tipo === "cliente") {
this.navigateCustomerHome();
}
// else {
// reindirizza alla home ristorante
// }
} else {
reject("LoginIncorrect");
}
Expand Down

0 comments on commit 58ae4e2

Please sign in to comment.