Closed mtzrmzia closed 3 months ago
Hi @alfredomtzrmz 👋
You have a slight misconfiguration inside your nuxt.config.ts
. The baseURL
should be in the root auth property and not inside the provider!
auth: {
+ baseURL: 'https://tx8_api.test/',
provider: {
- baseURL: 'https://tx8_api.test/',
type: 'refresh',
},
},
I did see, that inside the one example for external backends, we forgot to wrap the endpoints
in the provider object, I will quickly fix this in the docs 😊
I also created a small reproduction of this and setting the baseURL
correctly, properly resolves the external URL! See here: https://github.com/zoey-kaiser/nuxt-auth-reproductions/tree/802-external-base-url
@zoey-kaiser Thanks! But now i got this error net::ERR_CERT_COMMON_NAME_INVALID
and my config:
auth: {
baseURL: 'https://tx8_api.test/api/auth/',
provider: {
type: 'refresh',
endpoints: {
signIn: { path: 'login', method: 'post' },
signOut: { path: 'logout', method: 'post' },
signUp: false,
getSession: { path: 'me', method: 'get' },
refresh: { path: 'refresh', method: 'post' },
},
token: {
signInResponseTokenPointer: 'data/access_token',
cookieName: 'access_token',
type: 'Bearer',
maxAgeInSeconds: 60 * 60,
sameSiteAttribute: 'strict',
},
refreshOnlyToken: false,
refreshToken: {
signInResponseRefreshTokenPointer: 'data/access_token',
cookieName: 'access_token',
refreshRequestTokenPointer: 'access_token',
maxAgeInSeconds: 20160 * 60,
},
pages: {
login: '/login',
},
},
},
@zoey-kaiser nevermind, I forgot to set my virtual domain to secure 😅. Now works fine!
Environment
Darwin
v20.11.0
3.12.3
3.12.0
2.9.7
yarn@1.22.21
-
compatibilityDate
,devtools
,experimental
,components
,modules
,colorMode
,fonts
,auth
@nuxt/ui@2.17.0
,@nuxt/fonts@0.7.1
,@vueuse/nuxt@10.11.0
,@sidebase/nuxt-auth@0.8.0
-
Reproduction
I set the following config:
My backend is running in Valet (Laravel app) exposed in https://tx8_api.test/api and my Nuxt app is exposed in port 3000
Describe the bug
When I try to login, happens this The baseURL still the default one. On Postman the request is successfully
Additional context
I'm following the steps to use an external backend but doesn't work for me
No response
Logs
No response