NoamB/sorcery — pull request #320 by munkius (2012-07-21 08:27:09+00:00)
Title: When having logged in a user should not be redirected to a post, put or delete URL

When a user is not authenticated and performs a post, put or delete which requires authentication the user is first redirected to the login form. After a successful login the user is accordingly redirected to the original URL, however this URL was not accessible via a GET request.

This pull request makes sure session[:return_to_url] is only set upon a GET request. This way the redirect_back_or_to function will not redirect you to a unsupported location.

Must say, I'd much rather like to replay the original request instead of preventing a GET to it. The only way I can think of is to make use of Javascript, which is definitely not the way to go.