replace auth origin in runtime to enable usage with cloudlfare tunnels
Describe the feature
Currently this lib does not work with the inbuilt nuxi dev --tunnel dev environment. Thats because the library needs to know the origin of the page.
I already tried getting the tunnel url with a hook like this:
nuxt.hook('listen', async (_listenerServer, listener) => {
const urls: ListenerURL[] = await listener.getURLs();
const tunnelUrl = urls.find((url) => url.type === 'tunnel');
if (tunnelUrl) {
nuxt.options.runtimeConfig.baseURL = tunnelUrl.url; // <---- this does not seem to work
}
});
But replacing the url at runtime does not seem to work.
Input would be appreciated, I could try to make an PR then.
Additional information
No response
Hi @Niki2k1 👋
As we are currently working on the rewrite to using authjs under the hood (which does work for cloudflare), I would therefore not prioritize this issue, as it may be resolved by https://github.com/sidebase/nuxt-auth/issues/673!
@zoey-kaiser thats awesome, I'll check again when the rewrite to authjs is done.
@Niki2k1 You can patch the source code to make it work while we wait for a new version. https://github.com/sidebase/nuxt-auth/issues/691#issuecomment-1971226750