console-radar
For dev console app, there will be multiple tenant apps that exists in iframe.
console-radar
is a node package to catch route changes in the tenant app and communicate said change to the parent dev console app.
Installation
npm i @developerportalsg/console-radar --save
Getting Started
import { ConsoleRadar } from "@developerportalsg/console-radar";
const radar = new ConsoleRadar(config.parentEndpoint)
let clientSideCsrf = ''
radar.setSessionMngCallback(function({isAuthenticated, csrfToken}){
if(isAuthenticated){
clientSideCsrf = csrfToken
}
})
const notifySessionExpiry = (e) => {
e.preventDefault()
radar.notifyExpiredSession()
}