Devise Confirmable - Confirmation token can't be blank

339 views
Skip to first unread message

Sarosh Shahbuddin

unread,
Jan 1, 2014, 8:01:06 PM1/1/14
to plataforma...@googlegroups.com
Hey everyone,

Having an issue with Devise Confirmable confirmation email (using Devise 3.2.2).

I have email setup and I am able to receive an email with the confirmation token in the query string. Once I click on the default "confirm my account" link, I see the following error:

1 error prohibited this user from being saved:

  • Confirmation token can't be blank

Here's what I've done so far:

1. Added confirmable in user model
2. Modified the devise_create_users.rb migration my removing the comments under ## Confirmable.
3. Modified /config/environments/production.rb to configure the smtp settings and set config.action_mailer.default_url_options to the appropriate host.

Haven't seen anything like this before. Any help would be much appreciated!

Regards,

Sarosh Shahbuddin

Sarosh Shahbuddin

unread,
Jan 1, 2014, 8:42:39 PM1/1/14
to plataforma...@googlegroups.com
Also, the views/devise/mailer/confirmation_instructions.html.erb includes:

<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) %></p>

Regards,

Sarosh Shahbuddin

Sarosh Shahbuddin

unread,
Jan 1, 2014, 11:45:35 PM1/1/14
to plataforma...@googlegroups.com
Figured out the issue.

config.action_mailer.default_url_options equaled my top level domain, not www. When the link was clicked the application server returned a 301 to my www and removed the confirmation token from the query string. Changing config.action_mailer.default_url_options to www worked.

Regards,

Sarosh Shahbuddin

Mike Whittemore

unread,
Dec 30, 2014, 7:11:10 PM12/30/14
to plataforma...@googlegroups.com
Thank you for posting your solution! I had the same issue and your post helped me out!
Reply all
Reply to author
Forward
0 new messages