iTwin / viewer

Monorepo that contains the iTwin Viewer npm packages and their related packages
MIT License
26 stars 15 forks source link

no way to create a sign in frontstage without first loading a snapshot model #34

Closed MichaelBelousov closed 2 years ago

MichaelBelousov commented 3 years ago

looking at this line of BaseViewer, the viewer won't load unless IModelApp's authorizationClient is authorized, which won't happen until either:

I am trying to migrate an application from the older @bentley/itwin-viewer-react, but I was using a custom default frontstage to handle authenticating users, which is no longer possible. Is it possible to re-enable the previous behavior?

MichaelBelousov commented 3 years ago

another issue is that some components I want to use in my sign in page (i.e. SignIn from @bentley/ui-framework) require the UiFramework to be initialized, but the viewer is responsible for that, so am I supposed to render the viewer component but make it hidden with the sign in page over it, and it will successfully load once the viewer initializes the UiFramework, and I can remove the sign in page component and unhide the viewer once it is authorized or a snapshot iModel was selected for viewing?

EDIT: I can alternatively load a random snapshot at startup but default to a sign in frontstage and never let the user see the random snapshot view

MichaelBelousov commented 3 years ago

as a temporary workaround, I may ship a snapshot with our app to load silently at initialization time.

MichaelBelousov commented 3 years ago

also, we are planning on open sourcing the application I'm working on relatively soon, and in order to not publish it with a hack, (mostly needing to ship a snapshot iModel with it and open it at startup ), we can eventually submit a PR to fix this behavior.

aruniverse commented 2 years ago

iirc, this was resolved, right @MichaelBelousov ? If so, could you close the issue.

aruniverse commented 2 years ago

closing this issue, pretty sure it was resolved; can re-open if not