aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-09-16 10:11:51 +0100
committerGareth Rees <gareth@mysociety.org>2014-09-24 09:41:36 +0100
commit1150ce255c4f59da9404e1b4ccfc242b7902cbc7 (patch)
tree5021327065224ca06473386af57e19ed4c5340e5
parent967c422f3150da94c3756be84f35d021ed69f5e6 (diff)
Redirect GET signup to signinhotfix/0.19.0.6
After allowing only POST requests to signup in 316b1e: > What I think will happen at least sometimes is that someone will enter > information in the signup form, submit it via a post request, and end > up on the URL /profile/signup, at which point they want to refresh and > start again, at which point they hit the URL in the address bar to do > so. Currently that would mean they get a 404. I wonder about adding > another route match '/profile/sign_up' => 'user#signin', :as => > :signin, :via => :get to handle this case. That would mean that a get > request to profile/signup renders the empty form. > > – https://github.com/mysociety/alaveteli/pull/1850#issuecomment-55387700
-rw-r--r--config/routes.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 9f426fabf..f557e681b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -72,7 +72,8 @@ Alaveteli::Application.routes.draw do
# Use /user/XXXX for things that anyone can see about that user.
# Note that /profile isn't indexed by search (see robots.txt)
match '/profile/sign_in' => 'user#signin', :as => :signin
- match '/profile/sign_up' => 'user#signup', :as => :signup
+ match '/profile/sign_up' => 'user#signup', :as => :signup, :via => :post
+ match '/profile/sign_up' => 'user#signin', :via => :get
match '/profile/sign_out' => 'user#signout', :as => :signout
match '/c/:email_token' => 'user#confirm', :as => :confirm