Let us have some simple page that allows logged users to edit articles. Imagine following situation:
User Bob is logged into the system and is editing long article. As it takes really long to edit such article, his authentication becomes expired. After that, he clicks submit button and because of expired authentication, he is redirected to login page.
It is really desirable to finish the action (saving article) after his successful login. So we shall restore the request that was done while Bob was unauthenticated and repeat it now, after successful login. How could this be done with pyramids?
there are three parts you need;
...?fromurl=/post/a/comment. After the user successfully logs in, the login page should redirect the user to that page instead of the site’s front page.It’s important that step 3 should not perform the post directly; The original data and request came from a user who was not authenticated.