added error messages to login flow
This commit is contained in:
parent
08527d5aea
commit
864a47f502
3 changed files with 21 additions and 6 deletions
|
@ -1,5 +1,11 @@
|
|||
(function () {
|
||||
|
||||
function UserLoginCtrl($scope, $window) {
|
||||
// attempts to extract an error message from
|
||||
// the URL hash in format #error=?
|
||||
$scope.error = $window.location.hash.substr(7);
|
||||
}
|
||||
|
||||
/**
|
||||
* UserCtrl is responsible for managing user settings.
|
||||
*/
|
||||
|
@ -68,6 +74,7 @@
|
|||
|
||||
angular
|
||||
.module('drone')
|
||||
.controller('UserLoginCtrl', UserLoginCtrl)
|
||||
.controller('UserCtrl', UserCtrl)
|
||||
.controller('UsersCtrl', UsersCtrl);
|
||||
})();
|
|
@ -55,6 +55,7 @@
|
|||
})
|
||||
.when('/login', {
|
||||
templateUrl: '/static/scripts/views/login.html',
|
||||
controller: 'UserLoginCtrl'
|
||||
})
|
||||
.when('/profile', {
|
||||
templateUrl: '/static/scripts/views/user.html',
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
<h1>Login</h1>
|
||||
|
||||
<div ng-switch="error">
|
||||
<div ng-switch-when="internal_error">Oops. There was an unexpected error. Please try again.</div>
|
||||
<div ng-switch-when="user_not_found">There was an error authorizing your account.</div>
|
||||
<div ng-switch-when="access_denied_org">Login is restricted to approved organization members only</div>
|
||||
<div ng-switch-when="access_denied">Self-registration is disabled. Please contact the system admin to grant access.</div>
|
||||
</div>
|
||||
|
||||
<a href="/authorize" target="_self">Login</a>
|
Loading…
Reference in a new issue