commit
b844cd45c1
@ -15,7 +15,7 @@ export function check_validity(online_callback = () => {
|
||||
if (online_callback) online_callback(false); else return false;
|
||||
|
||||
if (online_callback) {
|
||||
return axios.get(`${vite_url}/auth-api/userinfo`, {
|
||||
return axios.get(`${auth_url}/userinfo`, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
@ -32,7 +32,7 @@ export function check_validity(online_callback = () => {
|
||||
}
|
||||
|
||||
export function sendTokenRequest(refresh) {
|
||||
return axios.post(`${vite_url}/auth-api/token`, {
|
||||
return axios.post(`${auth_url}/token`, {
|
||||
client_id: client_id,
|
||||
redirect_uri: `${vite_url}/complete/auth/`,
|
||||
grant_type: 'refresh_token',
|
||||
@ -54,7 +54,7 @@ export function sendTokenRequest(refresh) {
|
||||
}
|
||||
|
||||
export function sendTokenRequestPart2(code, state) {
|
||||
axios.post(`${vite_url}/auth-api/token`, {
|
||||
axios.post(`${auth_url}/token`, {
|
||||
client_id: client_id,
|
||||
redirect_uri: `${vite_url}/complete/auth/`,
|
||||
code: code,
|
||||
@ -95,7 +95,7 @@ function clearNext() {
|
||||
}
|
||||
|
||||
export function logout(token, refresh) {
|
||||
return axios.post(`${vite_url}/auth-api/revoke`, {
|
||||
return axios.post(`${auth_url}/revoke`, {
|
||||
client_id: client_id,
|
||||
token: refresh,
|
||||
}, {
|
||||
|
||||
@ -10,21 +10,6 @@ export default ({mode}) => {
|
||||
server: {
|
||||
host: process.env.VITE_INT_HOST,
|
||||
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/, ""),
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user