diff --git a/src/js/login.js b/src/js/login.js index 315514867..bb7ea9ef4 100644 --- a/src/js/login.js +++ b/src/js/login.js @@ -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); + }; }]); diff --git a/src/login.html b/src/login.html index 37aeb69e4..c94ac5570 100644 --- a/src/login.html +++ b/src/login.html @@ -42,13 +42,14 @@