vaadin / sso-kit

Other
11 stars 2 forks source link

The BootstrapDataServiceListener of Hilla starter uses window.Vaadin instead of window.Hilla to define SSO data #112

Closed taefi closed 1 year ago

taefi commented 1 year ago

The dev.hilla.sso.starter.BootstrapDataServiceListener in sso-kit-starter-hilla, the script used to define the SingleSignOnData looks like the following:

static final String SCRIPT_STRING = """
            window.Vaadin = window.Vaadin || {};
            window.Vaadin.SingleSignOnData = %s;
            """;

However, according to the React and Lit docs, users are supposed to access it like this:

(window as any).Hilla.SSO as SingleSignOnData;

So it seems that it should be defined as:

static final String SCRIPT_STRING = """
            window.Hilla = window.Hilla || {};
            window.Hilla.SSO = %s;
            """;

Having the SSO data under Hilla object seems to be more convenient for Hilla users, However, if it is not possible to change the code, please consider updating the above mentioned docs.

heruan commented 1 year ago

Thanks for reporting this! It will be fixed once https://github.com/vaadin/docs/pull/2274 gets merged.