Prevent admin from creating users with empty username (#37)

* Prevent admin from creating users with empty username

A error message shows when the admin tries to submit the form if the validation fails.

The error message was translated to Czech, Deutsch, English, Spanish and French, which are the currently compatible languages in the website.

* Move username validation logic to server side
This commit is contained in:
Coal 2022-10-06 10:57:42 -06:00 committed by GitHub
parent 001b81d6b5
commit 6900c401de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 24 additions and 0 deletions

View file

@ -13,6 +13,7 @@ block content
h3= lang('ADMIN_SETTINGS_USERS_ADD_HEADER')
form(action=`${_CC.config.base}admin-settings/add`, method='POST')
.field
p.has-text-danger#error-label= add_user_error
label.label= lang('ADMIN_SETTINGS_USERS_ADD_USERNAME')
.control.has-icons-left
input.input(type='text', name='newUserUsername', placeholder=lang('ADMIN_SETTINGS_USERS_ADD_PLACEHOLDER'))