You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw in the issue #60 that the support for nuxt baseURL is planned but not done yet. But we needed it asap for our project. So I decided to fix it. We published this to our company nexus but you can take it if you want.
I realized useRequestFetch, navigateTo , sendRedirect and the callbackRedirectUrl didn't work with correctly with a baseURL set. So I created a function which adds the baseURL to a passed url and added it to the named functions.
You can find the function to parse the URL here.
It tried to store the function in config but that doesn't work and the other files doesn't seem to fit. So I decided to create a new file. Maybe you have a better idea where to store it.
Test
Add NUXT_APP_BASE_URL=/app/ to .env or app: { baseURL: '/app/' } to nuxt.config and start the playground.
I tested it with the keycloak provider only. But it doesn't changes anything with the providers so (I think) there should be no Problem with other providers.
I was actually not able to reproduce the problem. I set a different baseURL in the nuxt config and all redirections from the composable and from the server continued to work based on how nuxt handles the redirections internally.
Can you provide a reproduction where this problem occurs?
Hello,
unfortunately, I have the same issue with baseURL. The problem is that there are two applications: one is hosted on NUXT_PUBLIC_SITE_URL (mysite.com) and the other one on NUXT_PUBLIC_SITE_URL/BASE_URL (mysite.com/v2)
The redirection from the composable is not possible, the provider simply calls mysite.com/auth/login which is completely different web app. I could make it through the ugly hack, instead of login() used /v2/auth/login.
However, I have another issue with callbackRedirectUrl.
The callback redirection is working fine on dev mode, but on prod mode the calback redirect url is always /. For publishing IIS setup is used.
I hope that at least the first issue could be solved by proposed changes in the PR, however not quite sure about the last one with callbackRedirectUrl.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I saw in the issue #60 that the support for nuxt baseURL is planned but not done yet. But we needed it asap for our project. So I decided to fix it. We published this to our company nexus but you can take it if you want.
I realized useRequestFetch, navigateTo , sendRedirect and the callbackRedirectUrl didn't work with correctly with a baseURL set. So I created a function which adds the baseURL to a passed url and added it to the named functions.
You can find the function to parse the URL here.
It tried to store the function in config but that doesn't work and the other files doesn't seem to fit. So I decided to create a new file. Maybe you have a better idea where to store it.
Test
Add NUXT_APP_BASE_URL=/app/ to .env or app: { baseURL: '/app/' } to nuxt.config and start the playground.
I tested it with the keycloak provider only. But it doesn't changes anything with the providers so (I think) there should be no Problem with other providers.