xm-online / xm-webapp

XM^online 2 - Open Source version of the XME.digital core platform
https://xme.digital
Apache License 2.0
14 stars 7 forks source link

fix(redirect-url): navigate once #2050

Closed Sumragen closed 6 months ago

Sumragen commented 6 months ago

Redirect user to previous url once logged in.

denisogolubev commented 6 months ago

The reason why it do it twice https://github.com/xm-online/xm-webapp/blob/20c504f8e1772c156f452f1ac0a2d51dcbac4832/packages/core/permission/src/user-route-access-service.ts#L63

if we remove this redirect, the bug when user after auth routes to the blank page will be fixed. Then the setTimeout will be unnecessary.

But I didn't have enough time to retest all cases and check if it impacts to the other functionality. Maybe this info is useful for you.

Sumragen commented 6 months ago

@denisogolubev For some reason I could agree with you, but just in context of "redundant redirect". setTimeout resolves another issue, especially dashboard one. In case when you remove line that you mention above user will face with incorrect system behavior after redirecting to some specific page while session is not present, because system will stuck on empty page. And one more time, as it was said in comment before, setTimeout resolves case when user tries to login immediately after logout, because due to lack of time for dashboard subscription we cannot retrieve fresh data according to user session.