0
votes

We noticed a white page blink when page refresh happens on site when the user is logged in. Also, we know that transfer state is not happening when the user has logged in and this is implemented intentionally since user data will be loaded again anyway.

Then we enabled transfer state for the logged-in users and there is one issue regarding acces_token.

Problem happens when acces_token becomes invalid and the page refreshed, so too many requests are made with the old acces_token (not an endless loop), and it's noticeable that acces_token changes more than a couple of times at that moment.

We assume that cms components make additional requests with the old token and we want to fix this somehow.

We are using Spartacus version 2.1.4

Any ideas on how to fix this?

Let me know if any more info is needed on this.

Thanks in advance.

This shows what is happening after you refresh the page when access_token is expired. Network tab

1

1 Answers

1
votes

I believe it's possible to face such issue when enabling transfer state for logged-in users. If you think it might be a bug or at least good candidate for a feature request please create a ticket: https://github.com/SAP/spartacus/issues/new/choose so the info for reproducing the issue will be provided.

Can you share what's the use case for enabling transfer state for authenticated users?

It might not be exactly the same case but some people deal with similar problem (flickering with SSR enabled for authenticated requests) using cookies:
send token to server in angular universal
Angular universal flickring with Transfer state