diff --git a/frontend/src/admin/AdminDialogs.vue b/frontend/src/admin/AdminDialogs.vue index 6504262..891a21e 100644 --- a/frontend/src/admin/AdminDialogs.vue +++ b/frontend/src/admin/AdminDialogs.vue @@ -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)