1

I want to add state while initiating login.

tried this way :

let obj = {state: 'customurl'};
usermanager.signinRedirect(obj);

and extracting :

usermanager.signinRedirectCallback().then(res => { res.state });

this is returning 'undefined'.

please assist.

2 Answers2

2

You can use signinRedirect({ state: { bar: 15 } }); //Generates 15 char state value.

hashbytes
  • 769
  • 1
  • 8
  • 26
  • No, still its not working,it is showing undefined, I want to pass some url as current state and want to use that state after login successful. but it only returns undefined. – Rajul Dixit Apr 10 '20 at 12:13
1

If what you want to get is the res.state in the chain then(res => { res.state }), then you just need to remove the { } wrapping the res.state.

bigopon
  • 1,924
  • 2
  • 14
  • 23