update sso
This commit is contained in:
@ -22,14 +22,20 @@ const TheContent = () => {
|
||||
|
||||
const [SsoSession, setSsoSession] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
async function fetchData() {
|
||||
// You can await here
|
||||
const result = await axios('https://fsbsso.sumasen.net/Shibboleth.sso/Session');
|
||||
setSsoSession(result.data);
|
||||
}
|
||||
fetchData();
|
||||
}, []);
|
||||
// useEffect(() => {
|
||||
// async function fetchData() {
|
||||
// // You can await here
|
||||
// const result = await axios('https://fsbsso.sumasen.net/Shibboleth.sso/Session');
|
||||
// setSsoSession(result.data);
|
||||
// }
|
||||
// fetchData();
|
||||
// }, []);
|
||||
|
||||
async function fetchSession() {
|
||||
// You can await here
|
||||
const result = await axios('https://fsbsso.sumasen.net/Shibboleth.sso/Session');
|
||||
setSsoSession(result.data);
|
||||
}
|
||||
|
||||
function get_token_from_storage_or_cookie() {
|
||||
const cookies = new Cookies();
|
||||
@ -37,8 +43,12 @@ const TheContent = () => {
|
||||
console.log(shib);
|
||||
console.log(SsoSession);
|
||||
console.log(SsoSession.includes('Session Summary'));
|
||||
if(shib !== undefined && SsoSession.includes('Session Summary')) {
|
||||
return true;
|
||||
if(shib !== undefined) {
|
||||
fetchSession();
|
||||
if(SsoSession.includes('Session Expiration')){
|
||||
return true;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
else{
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user