remove keycloak change use cookie only
This commit is contained in:
parent
24374ab8f2
commit
92b85ce4ef
23 changed files with 236 additions and 189 deletions
|
|
@ -1,25 +1,24 @@
|
|||
import axios from "axios"
|
||||
import config from "process"
|
||||
import axios from "axios";
|
||||
import { getToken } from "./auth";
|
||||
// import { dotnetPath } from "../path/axiosPath";
|
||||
// import { getToken } from "@baloise/vue-keycloak";
|
||||
import keycloak from "../plugins/keycloak"
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
withCredentials: false,
|
||||
})
|
||||
withCredentials: false,
|
||||
});
|
||||
|
||||
// axiosInstance.defaults.baseURL = dotnetPath;
|
||||
axiosInstance.interceptors.request.use(
|
||||
async (config) => {
|
||||
const token = await keycloak.token
|
||||
config.headers = {
|
||||
Authorization: `Bearer ${token}`,
|
||||
}
|
||||
return config
|
||||
},
|
||||
(error) => {
|
||||
Promise.reject(error)
|
||||
}
|
||||
)
|
||||
async (config) => {
|
||||
const token = await getToken();
|
||||
config.headers = {
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
return config;
|
||||
},
|
||||
(error) => {
|
||||
Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
export default axiosInstance
|
||||
export default axiosInstance;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue