Skip to content
Snippets Groups Projects
Commit 1e203e9f authored by Muthukrishnanmatriot's avatar Muthukrishnanmatriot
Browse files

TMSS-937 - Updated header content-type

parent 11c63128
No related branches found
No related tags found
2 merge requests!634WIP: COBALT commissioning delta,!577Resolves TMSS-937
......@@ -25,9 +25,10 @@ const AuthService = {
}
},
deAuthenticate: async(token) => {
let contentType = '';
try {
const loginType = localStorage.getItem("loginType");
if (loginType && loginType === 'Application') {
if (loginType && loginType !== 'Application') {
await axios.delete("/api/token-deauth/");
} else {
let token = '';
......@@ -36,12 +37,17 @@ const AuthService = {
user = JSON.parse(user);
token = user.token;
}
await axios.post(UIConstants.KEYCLOAK_LOGOUT_URL, {csrfmiddlewaretoken:token});
contentType = axios.defaults.headers.common['Content-Type'];
const formData = 'csrfmiddlewaretoken='+token;
await axios.post(UIConstants.KEYCLOAK_LOGOUT_URL, formData, {headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
}});
}
localStorage.removeItem("loginType");
} catch(error) {
console.error(error);
}
axios.defaults.headers.common['Content-Type'] = contentType;
},
isValidToken: async(token) => {
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment