Note that there are some explanatory texts on larger screens.

plurals
  1. POdevise confirmable not working in newest version
    text
    copied!<p>I recently upgraded from Devise 1.2 to 1.4.9 and everything seems to work except my confirmable module. Email works as well as the entire process. But the confirmation page is always blank. It works and it confirms the email account, but it does not redirect the user and throws a 406 error. It does the same for false confirmation attempts.</p> <p>Routes seem to work fine, I have confirmable specified in my user model, and nothing else has changed.</p> <p>Any ideas? Am I missing some settings or something I need to update for 1.4.9?</p> <p>UPDATE</p> <p>It seems to be a problem with the URL being generated. For some unknown reason it is prepending the confirmations URL with the user name? and that is causing it to break. But i'm still not sure how to fix it.</p> <p><a href="http://localhost:5000/users/confirmation.someusername?confirmation_token=R7apAPhC5c3rszvhsowp" rel="noreferrer">http://localhost:5000/users/confirmation.someusername?confirmation_token=R7apAPhC5c3rszvhsowp</a></p> <p>The username in the URL above causes the process not to work.</p> <p>I checked the diff between the controller in 1.2 (which works) and the new version.</p> <h1>1.2</h1> <pre><code> # GET /resource/confirmation?confirmation_token=abcdef def show self.resource = resource_class.confirm_by_token(params[:confirmation_token]) if resource.errors.empty? set_flash_message :notice, :confirmed sign_in_and_redirect(resource_name, resource) else render_with_scope :new end end </code></pre> <h1>1.4.9</h1> <pre><code> # GET /resource/confirmation?confirmation_token=abcdef def show self.resource = resource_class.confirm_by_token(params[:confirmation_token]) if resource.errors.empty? set_flash_message(:notice, :confirmed) if is_navigational_format? sign_in(resource_name, resource) respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource) } else respond_with_navigational(resource.errors, :status =&gt; :unprocessable_entity){ render_with_scope :new } end end protected # The path used after resending confirmation instructions. def after_resending_confirmation_instructions_path_for(resource_name) new_session_path(resource_name) end # The path used after confirmation. def after_confirmation_path_for(resource_name, resource) after_sign_in_path_for(resource) end </code></pre> <h1>error</h1> <pre><code>Started GET "/users/confirmation.sdfsdfsd?confirmation_token=vmxmx73xvM7sUfcvH9CX" for 127.0.0.1 at 2011-10-31 13:30:33 +0100 Processing by Devise::ConfirmationsController#show as Parameters: {"confirmation_token"=&gt;"vmxmx73xvM7sUfcvH9CX"} SQL (1.1ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"users"'::regclass AND a.attnum &gt; 0 AND NOT a.attisdropped ORDER BY a.attnum User Load (1.2ms) SELECT "users".* FROM "users" WHERE "users"."confirmation_token" = 'vmxmx73xvM7sUfcvH9CX' LIMIT 1 SQL (0.7ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"users"'::regclass AND a.attnum &gt; 0 AND NOT a.attisdropped ORDER BY a.attnum Completed 406 Not Acceptable in 28ms </code></pre>
 

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