Open zoey-kaiser opened 2 months ago
auth.baseURL
and AUTH_ORIGIN
:auth.baseURL
auth.baseURL
not set:
/api/auth
auth.baseURL
set to http://localhost:8080
http://localhost:8080
auth.baseURL
set to http://localhost:8080/auth
http://localhost:8080/auth
auth.baseURL
and AUTH_ORIGIN
auth.baseURL
not set, AUTH_ORIGIN
not set:
/api/auth
auth.baseURL
set to http://localhost:8080
, AUTH_ORIGIN
not set:
http://localhost:8080
auth.baseURL
set to http://localhost:8080
, AUTH_ORIGIN
set to http://localhost:8081
:
http://localhost:8081
auth.baseURL
set to http://localhost:8080
, AUTH_ORIGIN
set to http://localhost:8081/auth
:
http://localhost:8081/auth
auth.baseURL
:
auth.baseURL
set to /auth
AUTH_ORIGIN
not setauth.provider.endpoints.signIn.path
set to /login
/auth/login
AUTH_ORIGIN
:
auth.baseURL
not setAUTH_ORIGIN
set to /auth
auth.provider.endpoints.signIn.path
set to /login
/auth/login
auth.baseURL
:
auth.baseURL
set to http://localhost:8080/auth
AUTH_ORIGIN
not setauth.provider.endpoints.signIn.path
set to /login
http://localhost:8080/auth/login
AUTH_ORIGIN
:
auth.baseURL
not setAUTH_ORIGIN
set to http://localhost:8080/auth
auth.provider.endpoints.signIn.path
set to /login
http://localhost:8080/auth/login
Note: I tested that the internal URLs actually request internal URLs, but setting the path to a non existent route and ensuring I receive the Vue Router warning
This is a breaking change and needs to have its own minor release + docs if we settle on it.
It is! I had forgotten to add the label. However, I think these changes are desperately needed as the current logic makes no sense and limits how you can use it. E.g. I am working on a project where the external API routes are as follows:
localhost:8080/auth/login
localhost:8080/account/me
Adding /api/auth
if no path is provided, makes the URLs listed above incompatible with the local
provider, as there is no base path I can provide.
If I provide localhost:8080
as baseURL
it gets transformed to: localhost:8080/api/auth
which does not make sense IMO.
What happens to internal $fetch calls? Remember that they have a limitation - they only work when path starts with a /. And here are two facts that break it:
This logic has been removed, in favour of checking if origin
was provided. If you are using an internal API within your Nuxt Application, I do not expect the origin to be passed (as in all our our examples this is also not the case). If no origin is provided, the fetch requests are made internally, if one is provided they are handled as external URLs.
๐ Linked issue
closes #797, #878
โ Type of change
๐ Description
๐ Checklist