Admin UI: prefill new sign-in site with the admin's current origin on the current domain

This commit is contained in:
2026-09-07 00:12:49 +00:00
parent 38d994f312
commit 7f1688e1f5
+5 -2
View File
@@ -68,8 +68,11 @@ const LIST_VALIDATION = { origins: 'originValidation', related_origins: 'related
function addEntry(field) {
const d = props.dialog?.data
if (!d) return
// Prefill the in-domain list with the rp-id; related domains start blank
d[field].push(field === 'origins' ? realmRpId.value : '')
// Prefill the in-domain list: with the origin the admin is currently on
// when editing that very domain (so saving never locks them out), else
// with the rp-id (https default). Related domains start blank.
const onThisDomain = authStore.settings?.rp_id && d.rp_id === authStore.settings.rp_id
d[field].push(field === 'origins' ? (onThisDomain ? window.location.origin : realmRpId.value) : '')
d[LIST_VALIDATION[field]].push(null)
const i = d[field].length - 1
if (d[field][i]) validateEntry(field, i)