tushar10sh / sveltekit-oidc

Sveltekit + OpenID Auth (confidential flow with Keycloak) + SSR Auth
MIT License
46 stars 9 forks source link

Couldn't get this work with `svelte-kit dev` #3

Closed patrickleet closed 2 years ago

patrickleet commented 2 years ago

The server seems to be ok, but on the client side, the env substitution doesn't seem to be working on things inside node_modules

sveltekit-oidc.js?v=bf359c30:59 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'VITE_OIDC_ISSUER')

I forked the repo and was able to run it that way.

patrickleet commented 2 years ago

solution is probably an initializer type function that takes all the config options?

patrickleet commented 2 years ago

I used this awesome repo as a starting point for building a web3auth service and integration for logging in with metamask and issuing jwts and refresh tokens.

As such, I had to resolve these same issues there to get packaging working.

https://github.com/CloudNativeEntrepreneur/sveltekit-web3auth

I'll make some PRs back to this repo to make the same type of refactors if no one else gets to it first, but I won't have time to do it for another couple weeks!

simonjcarr commented 2 years ago

It worked out of the box for me.

I enabled Typescript support and was using node v16.13.1

tushar10sh commented 2 years ago

@patrickleet which version of node are you using? I am currently using node v14.17.1 for this project.

patrickleet commented 2 years ago

To be clear, checking out this repo and running it works.

Using it as an npm package does not.

Ive been using 16/17.

Don't remember what I tried for this.