|
@@ -9,13 +9,6 @@ import {
|
|
|
import { AuthProvider } from "../../providers/auth/auth";
|
|
|
import { HomePage } from "../home/home";
|
|
|
|
|
|
-/**
|
|
|
- * Generated class for the LoginPage page.
|
|
|
- *
|
|
|
- * See https://ionicframework.com/docs/components/#navigation for more info on
|
|
|
- * Ionic pages and navigation.
|
|
|
- */
|
|
|
-
|
|
|
@IonicPage()
|
|
|
@Component({
|
|
|
selector: "page-login",
|
|
@@ -35,18 +28,16 @@ export class LoginPage {
|
|
|
}
|
|
|
|
|
|
login() {
|
|
|
+ const alertText = {
|
|
|
+ title: "Login failed",
|
|
|
+ subTitle:
|
|
|
+ "Somthing went wrong while trying to log you in. Please try again.",
|
|
|
+ buttons: ["OK"]
|
|
|
+ };
|
|
|
+
|
|
|
this.authProvider
|
|
|
.login()
|
|
|
.then(() => this.navCtrl.setRoot(HomePage))
|
|
|
- .catch(err =>
|
|
|
- this.alertCtrl
|
|
|
- .create({
|
|
|
- title: "Login failed",
|
|
|
- subTitle:
|
|
|
- "Somthing went wrong while trying to log you in. Pleas try again.",
|
|
|
- buttons: ["OK"]
|
|
|
- })
|
|
|
- .present()
|
|
|
- );
|
|
|
+ .catch(err => this.alertCtrl.create(alertText).present());
|
|
|
}
|
|
|
}
|