Simplify password validation for cloudron update

This commit is contained in:
Johannes Zellner
2016-01-21 14:53:49 +01:00
parent d186084835
commit e1111ba2bb
2 changed files with 7 additions and 8 deletions

View File

@@ -54,8 +54,9 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
Client.update($scope.update.password, function (error) {
if (error) {
if (error.statusCode === 403) {
$scope.update.error.password = 'Incorrect password';
$scope.update.error.password = true;
$scope.update.password = '';
$scope.update_form.password.$setPristine();
$('#inputUpdatePassword').focus();
} else {
console.error('Unable to update.', error);