Skip to content

[CLOUD] fix defaultRoute for app/cloud/onboarding #221029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion x-pack/platform/plugins/shared/cloud/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class CloudPlugin implements Plugin<CloudSetup, CloudStart> {
},
async (context, request, response) => {
const { uiSettings, savedObjects } = await context.core;
const defaultRoute = await uiSettings.client.get<string>('defaultRoute');
const defaultRoute = await uiSettings.client.get<string>('defaultRoute', { request });
const nextCandidateRoute = parseNextURL(request.url.href);

const route = nextCandidateRoute === '/' ? defaultRoute : nextCandidateRoute;
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/functional_cloud/saml.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
'--xpack.security.authc.providers.saml.saml1.realm=saml1',
'--xpack.security.authc.providers.basic.basic1.order=1',
'--server.restrictInternalApis=false',
'--uiSettings.overrides.defaultRoute=/app/observability/landing',
],
},
uiSettings: {
Expand Down
9 changes: 9 additions & 0 deletions x-pack/test/functional_cloud/tests/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await deleteSavedObject();
});

it('Only redirect', async () => {
await browser.get(deployment.getHostPort() + `/app/cloud/onboarding`);
await find.byCssSelector('[data-test-subj="userMenuButton"]', 20000);

// We need to make sure that both path and hash are respected.
const currentURL = parse(await browser.getCurrentUrl());
expect(currentURL.pathname).to.eql('/app/observability/landing');
});

it('Redirect and save token', async () => {
await browser.get(
deployment.getHostPort() +
Expand Down