Require passwords when creating an admin user in the startup wizard
This commit is contained in:
parent
56a9ae0512
commit
246ff2353e
3 changed files with 28 additions and 14 deletions
|
@ -11,11 +11,11 @@
|
|||
<div class="fieldDescription">${SelectAdminUsername}</div>
|
||||
</div>
|
||||
<div class="inputContainer">
|
||||
<input is="emby-input" id="txtManualPassword" type="password" label="${LabelPassword}" />
|
||||
<div class="fieldDescription">${LeaveBlankToNotSetAPassword}</div>
|
||||
<input is="emby-input" id="txtManualPassword" type="password" label="${LabelPassword}" required="required" />
|
||||
<div class="fieldDescription">${PasswordRequiredForAdmin}</div>
|
||||
</div>
|
||||
<div class="inputContainer">
|
||||
<input is="emby-input" id="txtPasswordConfirm" type="password" label="${LabelPasswordConfirm}" />
|
||||
<input is="emby-input" id="txtPasswordConfirm" type="password" label="${LabelPasswordConfirm}" required="required" />
|
||||
</div>
|
||||
<p>${MoreUsersCanBeAddedLater}</p>
|
||||
</div>
|
||||
|
|
|
@ -11,19 +11,30 @@ function getApiClient() {
|
|||
}
|
||||
|
||||
function nextWizardPage() {
|
||||
Dashboard.navigate('wizardlibrary.html');
|
||||
Dashboard.navigate('wizardlibrary.html')
|
||||
.catch(err => {
|
||||
console.error('[Wizard > User] error navigating to library setup', err);
|
||||
});
|
||||
}
|
||||
|
||||
function onUpdateUserComplete(result) {
|
||||
console.debug('user update complete: ' + result);
|
||||
console.debug('[Wizard > User] user update complete:', result);
|
||||
loading.hide();
|
||||
nextWizardPage();
|
||||
}
|
||||
|
||||
async function onUpdateUserError(result) {
|
||||
const message = await result.text();
|
||||
console.warn('[Wizard > User] user update failed:', message);
|
||||
toast(globalize.translate('ErrorDefault'));
|
||||
loading.hide();
|
||||
}
|
||||
|
||||
function submit(form) {
|
||||
loading.show();
|
||||
const apiClient = getApiClient();
|
||||
apiClient.ajax({
|
||||
apiClient
|
||||
.ajax({
|
||||
type: 'POST',
|
||||
data: JSON.stringify({
|
||||
Name: form.querySelector('#txtUsername').value,
|
||||
|
@ -31,7 +42,9 @@ function submit(form) {
|
|||
}),
|
||||
url: apiClient.getUrl('Startup/User'),
|
||||
contentType: 'application/json'
|
||||
}).then(onUpdateUserComplete);
|
||||
})
|
||||
.then(onUpdateUserComplete)
|
||||
.catch(onUpdateUserError);
|
||||
}
|
||||
|
||||
function onSubmit(e) {
|
||||
|
|
|
@ -1287,6 +1287,7 @@
|
|||
"PackageInstallFailed": "{0} (version {1}) installation failed.",
|
||||
"ParentalRating": "Parental rating",
|
||||
"PasswordMatchError": "Password and password confirmation must match.",
|
||||
"PasswordRequiredForAdmin": "A password is required for admin accounts.",
|
||||
"PasswordResetComplete": "The password has been reset.",
|
||||
"PasswordResetConfirmation": "Are you sure you wish to reset the password?",
|
||||
"PasswordResetProviderHelp": "Pick a password reset provider to be used when this user requests a password reset.",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue