diff --git a/ui/app/controllers/vault/cluster/auth.js b/ui/app/controllers/vault/cluster/auth.js index e4f1f7b115e4..8733761393e5 100644 --- a/ui/app/controllers/vault/cluster/auth.js +++ b/ui/app/controllers/vault/cluster/auth.js @@ -10,7 +10,7 @@ export default Controller.extend({ namespaceQueryParam: alias('clusterController.namespaceQueryParam'), queryParams: [{ authMethod: 'with' }], wrappedToken: alias('vaultController.wrappedToken'), - authMethod: 'token', + authMethod: '', redirectTo: alias('vaultController.redirectTo'), updateNamespace: task(function*(value) { diff --git a/ui/tests/acceptance/auth-test.js b/ui/tests/acceptance/auth-test.js index 81ef6a171d02..e6d0a0b88e4b 100644 --- a/ui/tests/acceptance/auth-test.js +++ b/ui/tests/acceptance/auth-test.js @@ -37,24 +37,20 @@ module('Acceptance | auth', function(hooks) { let backends = supportedAuthBackends(); assert.expect(backends.length + 1); await visit('/vault/auth'); - assert.equal(currentURL(), '/vault/auth'); + assert.equal(currentURL(), '/vault/auth?with=token'); for (let backend of backends.reverse()) { await component.selectMethod(backend.type); - if (backend.type === 'token') { - assert.equal(currentURL(), `/vault/auth`, `has the correct URL for ${backend.type}`); - } else { - assert.equal( - currentURL(), - `/vault/auth?with=${backend.type}`, - `has the correct URL for ${backend.type}` - ); - } + assert.equal( + currentURL(), + `/vault/auth?with=${backend.type}`, + `has the correct URL for ${backend.type}` + ); } }); test('it clears token when changing selected auth method', async function(assert) { await visit('/vault/auth'); - assert.equal(currentURL(), '/vault/auth'); + assert.equal(currentURL(), '/vault/auth?with=token'); await component.token('token').selectMethod('github'); await component.selectMethod('token'); assert.equal(component.tokenValue, '', 'it clears the token value when toggling methods'); diff --git a/ui/tests/acceptance/redirect-to-test.js b/ui/tests/acceptance/redirect-to-test.js index b25e4b65c1b4..70bdf049903e 100644 --- a/ui/tests/acceptance/redirect-to-test.js +++ b/ui/tests/acceptance/redirect-to-test.js @@ -45,7 +45,7 @@ module('Acceptance | redirect_to query param functionality', function(hooks) { await visit(url); assert.equal( currentURL(), - `/vault/auth?redirect_to=${encodeURIComponent(url)}`, + `/vault/auth?redirect_to=${encodeURIComponent(url)}&with=token`, 'encodes url for the query param' ); // the login method on this page does another visit call that we don't want here @@ -56,7 +56,7 @@ module('Acceptance | redirect_to query param functionality', function(hooks) { test('redirect from root does not include redirect_to', async function(assert) { let url = '/'; await visit(url); - assert.equal(currentURL(), `/vault/auth`, 'there is no redirect_to query param'); + assert.equal(currentURL(), `/vault/auth?with=token`, 'there is no redirect_to query param'); }); test('redirect to a route after authentication with a query param', async function(assert) { @@ -64,7 +64,7 @@ module('Acceptance | redirect_to query param functionality', function(hooks) { await visit(url); assert.equal( currentURL(), - `/vault/auth?redirect_to=${encodeURIComponent(url)}`, + `/vault/auth?redirect_to=${encodeURIComponent(url)}&with=token`, 'encodes url for the query param' ); await auth.tokenInput('root').submit();