update sso

This commit is contained in:
2021-07-30 13:23:23 +05:30
parent bbe97299ff
commit f57267a65c
48 changed files with 100 additions and 83 deletions

View File

@ -1,4 +1,5 @@
import React, { Suspense } from 'react'
import React, { Suspense, useState, useEffect } from 'react'
import axios from 'axios';
//import Cookies from 'js-cookie';
import Cookies from 'universal-cookie';
import {
@ -19,9 +20,24 @@ const loading = (
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();
}, []);
function get_token_from_storage_or_cookie() {
console.log(SsoSession);
const cookies = new Cookies();
const shib = cookies.get('_shibsession_64656661756c7468747470733a2f2f66736273736f2e73756d6173656e2e6e65742f73686962626f6c657468')
if(shib !== null) {
//console.log(SsoSession);
}
console.log(shib);
return shib;
}

View File

@ -1,4 +1,5 @@
import React from 'react'
import axios from 'axios';
import { Link } from 'react-router-dom'
import {
CButton,