State is not stored
When a user is stored, the state property, which is hydrated with the state that has been echoed back from the server, is not stored, as per;
https://github.com/IdentityModel/oidc-client-js/blob/01c872abc145114c76d9491b242d4d814c07e22a/src/User.js#L48-L57
Is there a particular reason for this or is this an oversight?
That's by design. The state is available in the callback completing the protocol processing (e.g. signinRedirectCallback)
OK. Seems weird that it's a property on the user but then it's not actually persisted. Why doesn't _signinEnd return a response object, that contains the user and the state then? Make it explicit about what's happening with the data.
I like that idea, but it'd be breaking. I can do it for 3.0.
3.0?! It's only on 1.6, did you mean 2.0?
Fair enough though, definitely a breaking change. It'd be ideal to separate state and user entirely if that contract is getting broken anyway. The more explicit the better. Haven't looked into how feasible that is yet though.
Do you need any assistance?
Oh yea, I think I meant 2.0 -- I have too many OSS projects to maintain. :/
Does anyone have a solid way of accessing the state after final login redirect? The it seems cumbersome to need to store the state ourselves in session storage so that we can access it after the final login redirect. Is this a security measure?