Ensure we have proper login app entry points
This commit is contained in:
@@ -21,15 +21,6 @@ app.controller('LoginController', ['$scope', '$http', function ($scope, $http) {
|
||||
$scope.newPasswordRepeat = '';
|
||||
var API_ORIGIN = '<%= oauth.apiOrigin %>' || window.location.origin;
|
||||
|
||||
if (search.passwordReset) {
|
||||
$scope.mode = 'passwordReset';
|
||||
} else if (search.resetToken) {
|
||||
$scope.mode = 'newPassword';
|
||||
setTimeout(function () { $('#inputNewPassword').focus(); }, 200);
|
||||
} else {
|
||||
$scope.mode = 'login';
|
||||
}
|
||||
|
||||
$scope.onLogin = function () {
|
||||
$scope.busy = true;
|
||||
$scope.error = false;
|
||||
@@ -114,4 +105,15 @@ app.controller('LoginController', ['$scope', '$http', function ($scope, $http) {
|
||||
$scope.error = false;
|
||||
setTimeout(function () { $('#inputUsername').focus(); }, 200);
|
||||
};
|
||||
|
||||
$scope.showNewPassword = function () {
|
||||
window.document.title = 'Set New Password';
|
||||
$scope.mode = 'newPassword';
|
||||
setTimeout(function () { $('#inputNewPassword').focus(); }, 200);
|
||||
};
|
||||
|
||||
// Init into the correct view
|
||||
if (search.passwordReset) $scope.showPasswordReset();
|
||||
else if (search.resetToken) $scope.showNewPassword();
|
||||
else $scope.showLogin();
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user