Note that there are some explanatory texts on larger screens.

plurals
  1. POSign up causing redirect loop in Devise for Rails
    primarykey
    data
    text
    <p>Using Rails 3.2.9 and Devise 2.1.2. When users go to <code>http://localhost:3000/users/sign_up</code> (same for production with <code>localhost:3000</code> replaced with the URL), they sign up. When submitting they get redirected to <code>/users/sign_up</code> repeatedly. Chrome reports:</p> <pre><code>This webpage has a redirect loop The webpage at http://localhost:3000/users/sign_up has resulted in too many redirects. </code></pre> <p>The logs say that the user was created and the users table was also updated for signing in (and in fact the user was created and logged in on the website if we then go to another URL):</p> <pre><code> ←[1m←[35mSQL (1.0ms)←[0m INSERT INTO "users" ("created_at", "current_sign_in_at", "current_sign_in_ip", "em ail", "encrypted_password", "first_name", "last_name", "last_sign_in_at", "last_sign_in_ip", "middle_name", "p latform_id", "remember_created_at", "reset_password_sent_at", "reset_password_token", "sign_in_count", "update d_at", "username") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Sat, 17 Nov 201 2 08:39:33 PST -08:00], ["current_sign_in_at", nil], ["current_sign_in_ip", nil], ["email", "test@ucode.com"], ["encrypted_password", "$2a$10$NvmaFtw/JjILrkmkDNOi7ePj29qI3LRB2zTLAxsw6GRAW7PZekGme"], ["first_name", "Test" ], ["last_name", ""], ["last_sign_in_at", nil], ["last_sign_in_ip", nil], ["middle_name", ""], ["platform_id", 1], ["remember_created_at", nil], ["reset_password_sent_at", nil], ["reset_password_token", nil], ["sign_in_c ount", 0], ["updated_at", Sat, 17 Nov 2012 08:39:33 PST -08:00], ["username", "test"]] ←[1m←[36m (4.0ms)←[0m ←[1mcommit transaction←[0m ←[1m←[35m (0.0ms)←[0m begin transaction ←[1m←[36m (1.0ms)←[0m ←[1mUPDATE "users" SET "last_sign_in_at" = '2012-11-17 16:39:33.934552', "current_sig n_in_at" = '2012-11-17 16:39:33.934552', "last_sign_in_ip" = '127.0.0.1', "current_sign_in_ip" = '127.0.0.1', "sign_in_count" = 1, "updated_at" = '2012-11-17 16:39:33.953553' WHERE "users"."id" = 3←[0m ←[1m←[35m (4.0ms)←[0m commit transaction </code></pre> <p>Then the logs report the redirect loop:</p> <pre><code>Redirected to http://localhost:3000/users/sign_up Completed 302 Found in 178ms (ActiveRecord: 0.0ms) Started GET "/users/sign_up" for 127.0.0.1 at 2012-11-17 08:39:33 -0800 Processing by Devise::RegistrationsController#new as HTML ←[1m←[36mUser Load (0.0ms)←[0m ←[1mSELECT "users".* FROM "users" WHERE "users"."id" = 3 LIMIT 1←[0m Redirected to http://localhost:3000/users/sign_up Filter chain halted as :require_no_authentication rendered or redirected Completed 302 Found in 2ms (ActiveRecord: 0.0ms) Started GET "/users/sign_up" for 127.0.0.1 at 2012-11-17 08:39:34 -0800 </code></pre> <p>This surprisingly seems to be the default behavior as another new project experiences the exact same behavior. Am I not supposed to direct people to /users/sign_up to sign up?</p> <p>Output of <code>rake routes</code> related to users:</p> <pre><code> new_user_session GET /users/sign_in(.:format) devise/sessions#new user_session POST /users/sign_in(.:format) devise/sessions#create destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy user_password POST /users/password(.:format) devise/passwords#create new_user_password GET /users/password/new(.:format) devise/passwords#new edit_user_password GET /users/password/edit(.:format) devise/passwords#edit PUT /users/password(.:format) devise/passwords#update </code></pre> <p>cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel user_registration POST /users(.:format) devise/registrations#create new_user_registration GET /users/sign_up(.:format) devise/registrations#new edit_user_registration GET /users/edit(.:format) devise/registrations#edit PUT /users(.:format) devise/registrations#update DELETE /users(.:format) devise/registrations#destroy</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload