remove vite proxy

This commit is contained in:
Thibaut Valentin 2024-01-14 21:20:46 +01:00
parent 4bd7dd68c5
commit be69093c1d
2 changed files with 4 additions and 19 deletions

View File

@ -15,7 +15,7 @@ export function check_validity(online_callback = () => {
if (online_callback) online_callback(false); else return false; if (online_callback) online_callback(false); else return false;
if (online_callback) { if (online_callback) {
return axios.get(`${vite_url}/auth-api/userinfo`, { return axios.get(`${auth_url}/userinfo`, {
headers: { headers: {
Authorization: `Bearer ${token}` Authorization: `Bearer ${token}`
} }
@ -32,7 +32,7 @@ export function check_validity(online_callback = () => {
} }
export function sendTokenRequest(refresh) { export function sendTokenRequest(refresh) {
return axios.post(`${vite_url}/auth-api/token`, { return axios.post(`${auth_url}/token`, {
client_id: client_id, client_id: client_id,
redirect_uri: `${vite_url}/complete/auth/`, redirect_uri: `${vite_url}/complete/auth/`,
grant_type: 'refresh_token', grant_type: 'refresh_token',
@ -54,7 +54,7 @@ export function sendTokenRequest(refresh) {
} }
export function sendTokenRequestPart2(code, state) { export function sendTokenRequestPart2(code, state) {
axios.post(`${vite_url}/auth-api/token`, { axios.post(`${auth_url}/token`, {
client_id: client_id, client_id: client_id,
redirect_uri: `${vite_url}/complete/auth/`, redirect_uri: `${vite_url}/complete/auth/`,
code: code, code: code,
@ -95,7 +95,7 @@ function clearNext() {
} }
export function logout(token, refresh) { export function logout(token, refresh) {
return axios.post(`${vite_url}/auth-api/revoke`, { return axios.post(`${auth_url}/revoke`, {
client_id: client_id, client_id: client_id,
token: refresh, token: refresh,
}, { }, {

View File

@ -10,21 +10,6 @@ export default ({mode}) => {
server: { server: {
host: process.env.VITE_INT_HOST, host: process.env.VITE_INT_HOST,
port: process.env.VITE_INT_PORT, port: process.env.VITE_INT_PORT,
proxy: {
// $VITE_URL/api* -> $VITE_API_URL/api*
"/api": {
target: process.env.VITE_API_URL,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ""),
},
// $VITE_URL/auth-api* -> $VITE_AUTH_URL*
"^/auth-api": {
target: process.env.VITE_AUTH_URL,
changeOrigin: true,
secure: true,
rewrite: (path) => path.replace(/^\/auth-api/, ""),
},
},
}, },
}); });
}; };