Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace auth origin in runtime to enable usage with cloudlfare tunnels #655

Open
Niki2k1 opened this issue Feb 2, 2024 · 3 comments
Open
Labels
help-needed Action needed: The help of the community would be appreciated p2 Nice to have

Comments

@Niki2k1
Copy link

Niki2k1 commented Feb 2, 2024

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

@zoey-kaiser zoey-kaiser added p2 Nice to have help-needed Action needed: The help of the community would be appreciated and removed enhancement labels Feb 23, 2024
@zoey-kaiser
Copy link
Member

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 #673!

@Niki2k1
Copy link
Author

Niki2k1 commented Mar 5, 2024

@zoey-kaiser thats awesome, I'll check again when the rewrite to authjs is done.

@DavidDeSloovere
Copy link

@Niki2k1 You can patch the source code to make it work while we wait for a new version.
#691 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help-needed Action needed: The help of the community would be appreciated p2 Nice to have
Projects
None yet
Development

No branches or pull requests

3 participants