diff --git a/ui/admin/app/components/form/credential/username_password_domain/index.js b/ui/admin/app/components/form/credential/username_password_domain/index.js
index 8afd432a0..2bcb24e90 100644
--- a/ui/admin/app/components/form/credential/username_password_domain/index.js
+++ b/ui/admin/app/components/form/credential/username_password_domain/index.js
@@ -40,7 +40,9 @@ export default class FormCredentialUsernamePasswordDomainComponent extends Compo
// We let the server handle the validation in that case
// and only update the model if we have exactly one username and one domain after splitting
if (arr.length === 2) {
- const [username, domain] = arr;
+ const isDomainFirst = value.includes('\\');
+ const username = isDomainFirst ? arr[1] : arr[0];
+ const domain = isDomainFirst ? arr[0] : arr[1];
// Update the model with the values only if both username and domain are present
if (username && domain) {
diff --git a/ui/admin/tests/integration/components/form/credential/username-password-domain-test.js b/ui/admin/tests/integration/components/form/credential/username-password-domain-test.js
index 84274abc8..2b1adf108 100644
--- a/ui/admin/tests/integration/components/form/credential/username-password-domain-test.js
+++ b/ui/admin/tests/integration/components/form/credential/username-password-domain-test.js
@@ -18,8 +18,8 @@ module(
test('it renders', async function (assert) {
this.model = {};
- this.submit = () => { };
- this.cancel = () => { };
+ this.submit = () => {};
+ this.cancel = () => {};
await render(
hbs``,
);
@@ -35,8 +35,8 @@ module(
test('it splits the username and domain when the value contains delimiters such as `@` or `\\` on `onBlur`', async function (assert) {
this.model = { username: '', domain: '', authorized_actions: ['update'] };
- this.submit = () => { };
- this.cancel = () => { };
+ this.submit = () => {};
+ this.cancel = () => {};
await render(hbs`
{ };
- this.cancel = () => { };
+ this.submit = () => {};
+ this.cancel = () => {};
await render(hbs`
{ };
- this.cancel = () => { };
+ this.submit = () => {};
+ this.cancel = () => {};
await render(hbs`
{ };
- this.cancel = () => { };
+ this.submit = () => {};
+ this.cancel = () => {};
await render(hbs`
{ };
- this.cancel = () => { };
+ this.submit = () => {};
+ this.cancel = () => {};
await render(hbs`
{ };
- this.cancel = () => { };
+ this.submit = () => {};
+ this.cancel = () => {};
await render(hbs`
{ };
- this.cancel = () => { };
+ this.submit = () => {};
+ this.cancel = () => {};
await render(hbs`
{ };
+ this.cancel = () => {};
await render(hbs`