Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loadSerializedSession() {
if (typeof Storage !== "undefined") {
const serializedSession = localStorage.getItem(
"__ARCGIS_REST_USER_SESSION__"
);
if (serializedSession !== null && serializedSession !== "undefined") {
// If there is a serialized session, deserialize it into a new session object.
store.dispatch(
"updateSession",
UserSession.deserialize(serializedSession)
);
}
}
}
},
decoder: sessionContents => {
const sessionObj = JSON.parse(sessionContents);
sessionObj.userSession = UserSession.deserialize(
sessionObj.userSession
);
return sessionObj;
}
})