@@ -44,6 +44,7 @@ export default defineNuxtConfig({
4444 } ,
4545 modules : [
4646 '@nuxt-alt/auth' ,
47+ '@nuxt-alt/proxy' ,
4748 '@nuxt-alt/http' ,
4849 '@pinia/nuxt' ,
4950 'nuxt-quasar-ui' ,
@@ -73,17 +74,17 @@ export default defineNuxtConfig({
7374 } ,
7475 endpoints : {
7576 login : {
76- url : `${ SESAME_APP_API_URL } /core/auth/local` ,
77+ url : `/api /core/auth/local` ,
7778 method : 'post' ,
7879 headers : { 'Content-Type' : 'application/json' } ,
7980 } ,
8081 refresh : {
81- url : `${ SESAME_APP_API_URL } /core/auth/refresh` ,
82+ url : `/api /core/auth/refresh` ,
8283 method : 'post' ,
8384 headers : { 'Content-Type' : 'application/json' } ,
8485 } ,
85- logout : { url : `${ SESAME_APP_API_URL } /core/auth/logout` , method : 'post' } ,
86- user : { url : `${ SESAME_APP_API_URL } /core/auth/session` , method : 'get' } ,
86+ logout : { url : `/api /core/auth/logout` , method : 'post' } ,
87+ user : { url : `/api /core/auth/session` , method : 'get' } ,
8788 } ,
8889 redirect : {
8990 logout : '/login' ,
@@ -99,10 +100,19 @@ export default defineNuxtConfig({
99100 } ,
100101 } ,
101102 } ,
103+ proxy : {
104+ proxies : {
105+ '/api' : {
106+ rewrite : ( path : string ) => path . replace ( / ^ \/ a p i / , '' ) ,
107+ target : SESAME_APP_API_URL ,
108+ changeOrigin : true ,
109+ }
110+ } ,
111+ } ,
102112 http : {
103113 debug : / t r u e | o n | y e s | 1 / i. test ( `${ process . env . DEBUG } ` ) ,
104- browserBaseURL : SESAME_APP_API_URL ,
105- baseURL : SESAME_APP_API_URL ,
114+ browserBaseURL : '/api' ,
115+ baseURL : '/api' ,
106116 } ,
107117 dayjs : {
108118 locales : [ 'fr' , 'en' ] ,
0 commit comments