Add password reset feature in login view
This commit is contained in:
@@ -10,11 +10,13 @@ app.controller('LoginController', ['$scope', '$http', function ($scope, $http) {
|
||||
var search = decodeURIComponent(window.location.search).slice(1).split('&').map(function (item) { return item.indexOf('=') === -1 ? [item, true] : [item.slice(0, item.indexOf('=')), item.slice(item.indexOf('=')+1)]; }).reduce(function (o, k) { o[k[0]] = k[1]; return o; }, {});
|
||||
|
||||
$scope.initialized = false;
|
||||
$scope.passwordReset = !!search.passwordReset;
|
||||
$scope.busy = false;
|
||||
$scope.error = null;
|
||||
$scope.username = '';
|
||||
$scope.password = '';
|
||||
$scope.totpToken = '';
|
||||
$scope.passwordResetIdentifier = '';
|
||||
|
||||
$scope.onLogin = function () {
|
||||
$scope.busy = true;
|
||||
@@ -43,4 +45,18 @@ app.controller('LoginController', ['$scope', '$http', function ($scope, $http) {
|
||||
window.location.href = search.returnTo || '/';
|
||||
}).error(error);
|
||||
};
|
||||
|
||||
$scope.onPasswordReset = function () {
|
||||
|
||||
};
|
||||
|
||||
$scope.showPasswordReset = function () {
|
||||
$scope.passwordReset = true;
|
||||
setTimeout(function () { $('#inputPasswordResetIdentifier').focus(); }, 200);
|
||||
};
|
||||
|
||||
$scope.showLogin = function () {
|
||||
$scope.passwordReset = false;
|
||||
setTimeout(function () { $('#inputUsername').focus(); }, 200);
|
||||
};
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user