auth-module icon indicating copy to clipboard operation
auth-module copied to clipboard

Router-redirect to home when storage is only vuex

Open gopkumargopi opened this issue 4 years ago • 5 comments

I thought I would simply raise a PR and explain why I thought this change was relevant. Currently we have a customer who doesn't want any token data to be stored in either cookie or local storage but application state. Because the session information is saved with the authorization client and whenever the app tries to authenticate with a valid client-id the authorization client would respond back with code to query the token.

The auth-module say that we can set localStorage and cookie to false. But also it doesn't say we can set it to use vuex only. However, when I tried, the app kept on redirecting back and forth with auth client. After a lot of digging and debugging I found that the _handleCallback method calls the redirect method with noRouter option true. This makes no sense for vuex only session. Because the moment we access the full URL directly the vuex state is gone and the the authorize redirection happens again. So its imperative that we do and we can only do a router navigation.

gopkumargopi avatar Jul 05 '21 10:07 gopkumargopi

We faced similar issues with our project as well. It would be really helpful if someone could merge soon this!

Edit: We've verified that this PR fixes the issues in our project.

dominiklessel avatar Jul 08 '21 14:07 dominiklessel

I was struggling with state-only storage and this redirect. I've verified this PR and it indeed fixes the issue.

dominik-duzy avatar Jul 08 '21 15:07 dominik-duzy

Great find! It's been killing me, would appreciate the merge

r4fgacon avatar Jul 08 '21 17:07 r4fgacon

Same for me. Had to do a lot of workaround to make it working.

devzom avatar Aug 27 '21 04:08 devzom

Sorry to hijack this PR for a more general question but i can't find any reason for doing a browser redirect i any case, can someone enlighten me?

ViktorCollin avatar Apr 11 '22 09:04 ViktorCollin