How to use the @esri/arcgis-rest-auth.UserSession.completeOAuth2 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 / components / Authenticate.vue View on Github external
processAuthentication() {
      // Complete the OAuth2 process. If in a popup, the window will close before
      // this finishes and will be handled by the beginOAuth2 function. If not in
      // a popup, it will proceed to the next couple lines.
      const session = UserSession.completeOAuth2({
        // Required as it is a piece of the key in the popup method. If not using
        // a popup, this shouldn't be required.
        clientId: this.clientId
      });
      // Update the application store with the new session.
      this.$store.dispatch("updateSession", session);
      // The app is the rerouted to the main application.
      this.$router.replace("/");
    }
  }