Denoder / nuxt-module-alternatives

Alternative modules to use while waiting for Nuxt 3 Compatibility
MIT License
144 stars 14 forks source link

auth 2.1.2 --> ignores baseURL #116

Closed steklopod closed 1 year ago

steklopod commented 1 year ago

Environment

Reproduction

upgrade to `@nuxtjs-alt/auth": "^2.1.2"

Run

await useAuth().loginWith('local', { body: userPrincipal }) 

when

  http: { baseURL: 'https://host.com/api' }

Describe the bug

I upgraded to `@nuxtjs-alt/auth": "^2.1.2"

Снимок экрана 2022-11-11 в 17 59 36

and now

await useAuth().loginWith('local', { body: userPrincipal }) 

ignores http: { baseURL from nuxt.config by replacing it with localhost:3000

Снимок экрана 2022-11-11 в 16 43 53 Снимок экрана 2022-11-11 в 16 44 16 Снимок экрана 2022-11-11 в 16 50 30
Denoder commented 1 year ago

baseURL makes call to the server. You are using loginWith() which makes a call via the client side. (when you have ssr enable subsequent calls are made to the server if enabled.)

If you took a look at the http module the module is based off of, then you'd see that there is a browserBaseURL for client side handling.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.