How to use the @esri/arcgis-rest-auth.UserSession.deserialize function in @esri/arcgis-rest-auth

To help you get started, we’ve selected a few @esri/arcgis-rest-auth examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Esri / arcgis-rest-js / demos / vue / src / main.js View on Github external
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)
          );
        }
      }
    }
  },
github Esri / arcgis-rest-js / demos / webmap-checker-sapper / src / server.js View on Github external
decoder: sessionContents => {
          const sessionObj = JSON.parse(sessionContents);
          sessionObj.userSession = UserSession.deserialize(
            sessionObj.userSession
          );
          return sessionObj;
        }
      })