Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
fix: custom state
Browse files Browse the repository at this point in the history
  • Loading branch information
pamapa committed Dec 15, 2021
1 parent 2e1db1a commit 542e7c3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions samples/Parcel/src/code-flow-identityserver/sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function revokeAccessToken() {
}

function startSigninMainWindow() {
mgr.signinRedirect(/*{useReplaceToNavigate:true}*/).then(function() {
mgr.signinRedirect({ state: { foo: "bar" } /*, useReplaceToNavigate: true*/ }).then(function() {
log("signinRedirect done");
}).catch(function(err) {
console.error(err);
Expand All @@ -148,10 +148,9 @@ function startSigninMainWindow() {
function endSigninMainWindow() {
mgr.signinCallback().then(function(user) {
log("signed in", user);
// this is how you get the state after the login:
var theState = user.state;
var theMessage = theState.message;
console.log("here's our post-login state", theMessage);
// this is how you get the custom state after the login:
var customState = user.state;
console.log("here's our post-login custom state", customState);
}).catch(function(err) {
console.error(err);
log(err);
Expand Down

0 comments on commit 542e7c3

Please sign in to comment.