Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

A login page is predicted for an authorized user #15

Closed
dnesteryuk opened this issue Nov 22, 2016 · 1 comment
Closed

A login page is predicted for an authorized user #15

dnesteryuk opened this issue Nov 22, 2016 · 1 comment
Labels

Comments

@dnesteryuk
Copy link
Collaborator

dnesteryuk commented Nov 22, 2016

Context: There is a site which prevents authorized users from accessing the login page. If the authorized user tries to access the login page, that user gets redirected to the index page behind the login.

Problem: When the login page gets predicted for the authorized user, the browser pre-renders the index page. After logout, it results in showing the index page instead of the login.

This scenario depends on an actual implementation of a site. But, it is a real case and the engine should provide a way to configure such things in order to avoid prerendering of wrong pages.

@dnesteryuk dnesteryuk added the bug label Nov 22, 2016
@dnesteryuk dnesteryuk modified the milestones: 0.0.1, 0.1 Nov 22, 2016
@dnesteryuk dnesteryuk removed this from the 0.1 milestone Jan 4, 2017
dnesteryuk added a commit to sirko-io/client that referenced this issue Dec 18, 2017
Also fixes: sirko-io/engine#10, sirko-io/engine#15

When a user navigates between pages, there might be POST/PUT/DELETE
requests. Those requests modify state, so a prefetched page might be
stale.

Example

  GET /signin
  POST /signin
  GET /index

If the transition between the signin and index pages got tracked,
the index page would be prefetched when the user opens the signin page.
This behavior's been leaded to a number of issues.

To avoid the described issue, the service worker
stores all made requests on a page then the client part
asks the service worker to check whether there was a POST/PUT/DELETE
request between the referrer and the current page. If so,
the transition isn't tracked (the referrer parameter gets removed, thus,
the engine doesn't track the transition), but the engine makes a prediction
for the current page anyway. The transition is about the previous
and the current page, the prediction is about the next page.
@dnesteryuk
Copy link
Collaborator Author

This case is handled by the client. See the attached commit for more details.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant