Give error feedback if client name is invalid

This commit is contained in:
Johannes Zellner
2016-06-23 10:34:26 +02:00
parent 1bf869963b
commit fd22f0d52b
2 changed files with 5 additions and 1 deletions

View File

@@ -43,6 +43,10 @@ angular.module('Application').controller('TokensController', ['$scope', 'Client'
$scope.clientAdd.error.redirectURI = error.message;
$scope.clientAddForm.redirectURI.$setPristine();
$('#clientAddRedirectURI').focus();
} else if (error.message.indexOf('Username can only contain alphanumerals and dash') === 0) {
$scope.clientAdd.error.name = error.message;
$scope.clientAddForm.name.$setPristine();
$('#clientAddName').focus();
} else if (error.message.indexOf('Invalid scope') === 0) {
$scope.clientAdd.error.scope = error.message;
$scope.clientAddForm.scope.$setPristine();