updated sso
This commit is contained in:
parent
06b0e1dcbd
commit
6538140333
6 changed files with 111 additions and 94 deletions
|
|
@ -1,25 +1,25 @@
|
|||
import axios from "axios"
|
||||
import config from "process"
|
||||
import axios from 'axios'
|
||||
import config from 'process'
|
||||
// import { dotnetPath } from "../path/axiosPath";
|
||||
// import { getToken } from "@baloise/vue-keycloak";
|
||||
import keycloak from "@/plugins/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 keycloak.token
|
||||
config.headers = {
|
||||
Authorization: `Bearer ${token}`,
|
||||
}
|
||||
return config
|
||||
},
|
||||
(error) => {
|
||||
Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default axiosInstance
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue