-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error during signin when vue-router currentRoute contains a circular reference. #75
Comments
I've come across a similar issue, however only as a result of I am trying to have a functionality to allow the user to log back in after an expired session using popup sign-in. I want the user to click a button for the pop-up to appear. The inbuilt events however call
I suspect this might be due to a change in vue-router, if a self-reference has been added to the route objects. I am using vue-router Since the internal event handlers call this method, I'm unsure if there's any way to remove/control the behaviour of the handlers to override them. After testing locally by removing the I suspect a fix/change for what I'm looking for would involved;
|
@leokolezhuk @SeanLMcCullough |
@fezebr, I have made a patch (for my project) that sets a different state in those two lines of code mentioned earlier. |
@leokolezhuk tnx |
If the stored state ends up containing an object with a circular reference, an error occurs during the _signinStart of the oidc-client.
This results in the signin process not succeeding.
The error comes from the oidc-client trying to store the state json in localStorage here.
Error:
TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Or'
| property '$options' -> object with constructor 'Object'
| property 'router' -> object with constructor 'we'
--- property 'app' closes the circle
at JSON.stringify ()
at e.toStorageString (chunk-vendors.08958c8f.js:formatted:26453:30)
at chunk-vendors.08958c8f.js:formatted:26078:73
I am not exactly sure under what circumstances the circular reference is created in the Vue router that causes it, but I wonder if it is necessary to use the entire object for the state snapshots:
https://github.com/soukoku/vue-oidc-client/blob/master/vue3/src/vue-oidc-client.ts#L332
https://github.com/soukoku/vue-oidc-client/blob/master/vue3/src/vue-oidc-client.ts#L276
I think ultimately the full path of the route should already be enough to store here, making it more robust to what the vue-router does with the currentRoute object.
The text was updated successfully, but these errors were encountered: