dopry/svelte-oidc

Have you tried running it with a sapper?

stilet opened this issue · 5 comments

Have you tried running it with a sapper? Unfortunately, it didn't work out.

dopry commented
dopry commented

What specifically didn't work out for you?

It needs to be SSR compatible to work

dopry commented

@nikibreg @stillet or write your sapper markup so that you don't load the OIDC Context server side like mentioned in dopry/svelte-auth0#4. . This is a pure SPA implementation of Auth. SSR isn't on my roadmap right now. It required a different OIDC Auth Flow than the pure SPA auth flow I built this component for. I'm open to someone helping clarify this in the docs or adding the feature. https://github.com/auth0/nextjs-auth0 has a decent implementation for SSR auth IIRC.

Ideally, SSR compatibility with would driven by a choice of the OAuth Authorization flow. I'm just not sure how well that will work with the https://github.com/IdentityModel/oidc-client-js, but I feel like it would be some sort of branch condition happening in inside the OIDCContext.

Note that OnMount doesn't work so well in this becuase of the use of contexts to share the oidc client instance with the commands exposed for child components.

dopry commented

I updated the docs a bit to call out that the module isn't necessarily SSR compatible.