Ensure we have proper login app entry points

This commit is contained in:
Johannes Zellner
2020-02-05 11:54:31 +01:00
parent 4bc1d5cd4a
commit 3f2b59e67f

View File

@@ -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();
}]);