diff --git a/app/index.html b/app/index.html index 3765fb0bb..ef7137d15 100644 --- a/app/index.html +++ b/app/index.html @@ -25,8 +25,8 @@
diff --git a/app/portainer/__module.js b/app/portainer/__module.js index 7a7df77e9..04dfa7235 100644 --- a/app/portainer/__module.js +++ b/app/portainer/__module.js @@ -452,18 +452,6 @@ angular.module('portainer.app', []).config([ }, }; - var updatePassword = { - name: 'portainer.updatePassword', - url: '/update-password', - views: { - 'content@': { - templateUrl: './views/update-password/updatePassword.html', - controller: 'UpdatePasswordController', - }, - 'sidebar@': {}, - }, - }; - var users = { name: 'portainer.users', url: '/users', @@ -565,7 +553,6 @@ angular.module('portainer.app', []).config([ $stateRegistryProvider.register(support); $stateRegistryProvider.register(supportProduct); $stateRegistryProvider.register(tags); - $stateRegistryProvider.register(updatePassword); $stateRegistryProvider.register(users); $stateRegistryProvider.register(user); $stateRegistryProvider.register(teams); diff --git a/app/portainer/views/auth/authController.js b/app/portainer/views/auth/authController.js index a0eb03acc..a2acfc0be 100644 --- a/app/portainer/views/auth/authController.js +++ b/app/portainer/views/auth/authController.js @@ -8,7 +8,6 @@ class AuthenticationController { $scope, $state, $stateParams, - $sanitize, $window, Authentication, UserService, @@ -26,7 +25,6 @@ class AuthenticationController { this.$state = $state; this.$stateParams = $stateParams; this.$window = $window; - this.$sanitize = $sanitize; this.Authentication = Authentication; this.UserService = UserService; this.EndpointService = EndpointService; @@ -55,7 +53,6 @@ class AuthenticationController { this.postLoginSteps = this.postLoginSteps.bind(this); this.oAuthLoginAsync = this.oAuthLoginAsync.bind(this); - this.retryLoginSanitizeAsync = this.retryLoginSanitizeAsync.bind(this); this.internalLoginAsync = this.internalLoginAsync.bind(this); this.authenticateUserAsync = this.authenticateUserAsync.bind(this); @@ -182,15 +179,6 @@ class AuthenticationController { } } - async retryLoginSanitizeAsync(username, password) { - try { - await this.internalLoginAsync(this.$sanitize(username), this.$sanitize(password)); - this.$state.go('portainer.updatePassword'); - } catch (err) { - this.error(err, 'Invalid credentials'); - } - } - async internalLoginAsync(username, password) { await this.Authentication.login(username, password); await this.postLoginSteps(); @@ -211,13 +199,7 @@ class AuthenticationController { this.state.loginInProgress = true; await this.internalLoginAsync(username, password); } catch (err) { - if (this.state.permissionsError) { - return; - } - // This login retry is necessary to avoid conflicts with databases - // containing users created before Portainer 1.19.2 - // See https://github.com/portainer/portainer/issues/2199 for more info - await this.retryLoginSanitizeAsync(username, password); + this.error(err, 'Unable to login'); } } diff --git a/app/portainer/views/update-password/updatePassword.html b/app/portainer/views/update-password/updatePassword.html deleted file mode 100644 index 1070ccb99..000000000 --- a/app/portainer/views/update-password/updatePassword.html +++ /dev/null @@ -1,83 +0,0 @@ -
- -
-
- -
-
-
- -
-
- - Your password must be updated. - -
-
- - -
- -
- -
-
- - -
- -
- -
-
- - -
- -
-
- - -
-
-
- - -
-
- - - The password must be at least 8 characters long - -
-
- - -
-
- -
-
- -
-
-
- -
-
- -
diff --git a/app/portainer/views/update-password/updatePasswordController.js b/app/portainer/views/update-password/updatePasswordController.js deleted file mode 100644 index ebf229aa6..000000000 --- a/app/portainer/views/update-password/updatePasswordController.js +++ /dev/null @@ -1,44 +0,0 @@ -angular.module('portainer.app').controller('UpdatePasswordController', [ - '$scope', - '$state', - '$transition$', - '$sanitize', - 'UserService', - 'Authentication', - 'Notifications', - function UpdatePasswordController($scope, $state, $transition$, $sanitize, UserService, Authentication, Notifications) { - $scope.formValues = { - CurrentPassword: '', - Password: '', - ConfirmPassword: '', - }; - - $scope.state = { - actionInProgress: false, - }; - - $scope.updatePassword = function () { - var userId = Authentication.getUserDetails().ID; - - $scope.state.actionInProgress = true; - UserService.updateUserPassword(userId, $sanitize($scope.formValues.CurrentPassword), $scope.formValues.Password) - .then(function success() { - $state.go('portainer.home'); - }) - .catch(function error(err) { - Notifications.error('Failure', err, 'Unable to update password'); - }) - .finally(function final() { - $scope.state.actionInProgress = false; - }); - }; - - function initView() { - if (!Authentication.isAuthenticated()) { - $state.go('portainer.auth'); - } - } - - initView(); - }, -]);