diff --git a/application/User/UserController.php b/application/User/UserController.php index b96af6425..474a12468 100644 --- a/application/User/UserController.php +++ b/application/User/UserController.php @@ -190,9 +190,7 @@ class UserController extends mfBaseController $user->apikey = $user->createApiKey(); $user->save(); - $this->layout()->setFlash("API Key erfolgreich generiert.", "success"); - $this->redirect("User", "edit", ['id' => $id]); - + self::returnJson(['success' => true]); } protected function saveAction() { diff --git a/public/js/pages/UserEdit/UserEdit.js b/public/js/pages/UserEdit/UserEdit.js index e3fd97d56..0d8622d34 100644 --- a/public/js/pages/UserEdit/UserEdit.js +++ b/public/js/pages/UserEdit/UserEdit.js @@ -275,6 +275,12 @@ Vue.component("UserEdit", { return; } + if (this.isNewUser && !this.password.new) { + window.notify('error', 'Bitte Passwort angeben.'); + this.isSaving = false; + return; + } + if (this.password.new && this.password.new !== this.password.repeat) { window.notify('error', 'Die Passwörter stimmen nicht überein!'); this.isSaving = false;