update report no date check session

This commit is contained in:
Mohamed Nouffer
2021-09-03 13:25:52 +05:30
parent 30737948f5
commit fc7c925729
13 changed files with 47 additions and 40 deletions

View File

@ -31,6 +31,7 @@ const TheContent = () => {
// You can await here
const result = await axios('https://fsbsso.sumasen.net/Shibboleth.sso/Session');
if(JSON.stringify(SsoSession) !== JSON.stringify(result.data)) {
console.log(SsoSession);
setSsoSession(result.data);
}
}
@ -56,29 +57,30 @@ const TheContent = () => {
}
async function fetchUser() {
if(SsoSession.attributes[0] === undefined) {
return false;
}
const user_email = SsoSession.attributes[0].values[0]
//console.log(user_email);
const company_code = "FBS";
const key = "api"
const pwd = "c558a56c63c44f65956adde8863ecc3558f3e55a465d4338bb2e7d2692866fd8";
const result = await axios.get('https://fsbsso.sumasen.net/users?email=' + user_email, {
auth: {
username: key,
password: pwd
}
}).catch((err) => {
console.log(err);
return false;
});
//console.log(result.data);
if(JSON.stringify(UserData) !== JSON.stringify(result.data[0])) {
setUserData(result.data[0]);
}
return true;
// if(SsoSession.attributes[0] === undefined) {
// return false;
// }
// const user_email = SsoSession.attributes[0].values[0]
// //console.log(user_email);
// const company_code = "FBS";
// const key = "api"
// const pwd = "c558a56c63c44f65956adde8863ecc3558f3e55a465d4338bb2e7d2692866fd8";
// const result = await axios.get('https://fsbsso.sumasen.net/users?email=' + user_email, {
// auth: {
// username: key,
// password: pwd
// }
// }).catch((err) => {
// console.log(err);
// return false;
// });
// //console.log(result.data);
// if(JSON.stringify(UserData) !== JSON.stringify(result.data[0])) {
// setUserData(result.data[0]);
// }
// return true;
}
function isCSVPath(){