Add ?no_universal_links=true to OIDC url so EX doesn't try to handle it (#29439)

* Add `?no_universal_links=true` to OIDC cb url so EX doesn't try to handle it

This is specific to macOS and only affects cases where auth is attempted in the non-default browser

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Strip no_universal_links after auth

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update MAS

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update playwright-common

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Bump @element-hq/element-web-playwright-common

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2025-08-11 14:26:11 +01:00
committed by GitHub
parent 7951e48291
commit 2395cb1402
3 changed files with 25 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
/**
* @jest-environment jsdom
* @jest-environment-options {"url": "https://app.element.io/?loginToken=123&state=abc&code=xyz&no_universal_links&something_else=value"}
*/
/*
Copyright 2024 New Vector Ltd.
@@ -42,11 +47,27 @@ describe("showError", () => {
describe("loadApp", () => {
beforeEach(setUpMatrixChatDiv);
it("should set window.matrixChat to the MatrixChat instance", async () => {
beforeEach(async () => {
fetchMock.get("https://matrix.org/_matrix/client/versions", { versions: ["v1.6"] });
SdkConfig.put({ default_server_config: { "m.homeserver": { base_url: "https://matrix.org" } } });
});
it("should set window.matrixChat to the MatrixChat instance", async () => {
await loadApp({});
await waitFor(() => expect(window.matrixChat).toBeInstanceOf(MatrixChat));
});
it("should pass onTokenLoginCompleted which strips searchParams to MatrixChat", async () => {
const spy = jest.spyOn(window.history, "replaceState");
await loadApp({});
await waitFor(() => expect(window.matrixChat).toBeInstanceOf(MatrixChat));
window.matrixChat!.props.onTokenLoginCompleted();
expect(spy).toHaveBeenCalledWith(
null,
"",
expect.stringContaining("https://app.element.io/?something_else=value"),
);
});
});