Showing Login Errors
diff --git a/applications/subscriberPortal/src/app/view/common/common.css b/applications/subscriberPortal/src/app/view/common/common.css
index 5ae154b..800fe24 100644
--- a/applications/subscriberPortal/src/app/view/common/common.css
+++ b/applications/subscriberPortal/src/app/view/common/common.css
@@ -34,7 +34,7 @@
h1, h2, h3, h4, h5, h6,
p, a, li, th, td,
-select, input, option, label {
+select, input, option, label, div {
font-family: sans-serif, "Droid Sans", "Lucida Grande", Arial, Helvetica;
color: #3C3C3C;
}
diff --git a/applications/subscriberPortal/src/app/view/login/login.css b/applications/subscriberPortal/src/app/view/login/login.css
index f7d5f67..b4275c5 100644
--- a/applications/subscriberPortal/src/app/view/login/login.css
+++ b/applications/subscriberPortal/src/app/view/login/login.css
@@ -73,6 +73,20 @@
border-radius: 1px;
position: absolute;
}
+
+#login-form .login-error{
+ background: red;
+ border: 2px solid darkred;
+ color: white;
+ position: absolute;
+ height: 40px;
+ width: 230px;
+ padding: 0 5px;
+ border-radius: 1px;
+ top: 70px;
+ font-size: 10px;
+}
+
#login-form input[type="text"] {
top: -90px;
}
diff --git a/applications/subscriberPortal/src/app/view/login/login.html b/applications/subscriberPortal/src/app/view/login/login.html
index 19c5940..6359cce 100644
--- a/applications/subscriberPortal/src/app/view/login/login.html
+++ b/applications/subscriberPortal/src/app/view/login/login.html
@@ -4,10 +4,14 @@
<div id="login-form">
<div class="outline"></div>
<h2>Subscriber Portal</h2>
- <form>
+ <form ng-submit="login()">
<input ng-model="email" type="text" placeholder="email" required>
<input ng-model="password" type="password" placeholder="password" required>
<input ng-click="login()" type="button" value="Log In">
+ <div class="login-error" ng-show="error">
+ Sorry, your login failed.
+ Please try again.
+ </div>
</form>
</div>
</div>
diff --git a/applications/subscriberPortal/src/app/view/login/login.js b/applications/subscriberPortal/src/app/view/login/login.js
index c902480..77ef724 100644
--- a/applications/subscriberPortal/src/app/view/login/login.js
+++ b/applications/subscriberPortal/src/app/view/login/login.js
@@ -29,6 +29,9 @@
User.login($scope.email, $scope.password)
.then(function(user){
$location.url('/home');
+ })
+ .catch(function(e){
+ $scope.error = true;
});
$scope.shared.login = $scope.email;