Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with user sign-up and confirmation #193

Closed
greenplastik opened this issue Apr 11, 2010 · 13 comments
Closed

Error with user sign-up and confirmation #193

greenplastik opened this issue Apr 11, 2010 · 13 comments

Comments

@greenplastik
Copy link

Versions:
Ruby: 1.8.7 (p249)
Rails: 2.3.5
Devise (gem): 1.0.6

User.rb:
class User < ActiveRecord::Base
devise :registerable, :database_authenticatable, :confirmable, :recoverable, :rememberable, :trackable, :validatable, :lockable, :timeoutable, :timeout_in => 2.hours
...
end
When I sign up a new user, it creates the user in the DB, it creates the confirmation_token and sends the confirmation email.

However, it also appears to be skipping the confirmation process, because it is redirecting to the home site and giving me the flash message of "You have signed up successfully." with the word "true" above it (inside of a div with the id "flash_user_signed_up"). Furthermore, the user's "Profile" link and the "Sign out" link show up, even though they only should if the user is logged in.

My development.log shows the user's sign_in_count incrementing. So it's definitely logging the user in. If I log out and try logging the user in manually, it lets it log in, even though I have not yet clicked the confirmation link.

Then, if I click the confirmation link, it gives me the account successfully confirmed message.

I haven't unpacked and/or changed the devise gem. Any thoughts?

@josevalim
Copy link
Contributor

I just tried it and I cannot reproduce. Can you please create a small application and publish on Github so I can investigate further?

@josevalim
Copy link
Contributor

To be more specific, it's ok to appear "You have signed up successfully." but it's not ok to increase the sign_in_count neither be able to sign in.

About the "true" and "flash_user_signed_up", you will have to check if the value inside the flash message is a String before showing it.

@greenplastik
Copy link
Author

Oddly, I can't reproduce the logging in without confirming error on the test app either. Here it is in case you want to poke around:

http://github.com/greenplastik/Devise-Test-App

Obviously the username and password in the mailer.rb in initializers needs to be changed.

@josevalim
Copy link
Contributor

Are you overwriting the method "active?" in your models? Or have a column named "active"?

@greenplastik
Copy link
Author

I have an active column in my other app on a completely unrelated model. Not on the user model though.

I fixed the "true" thing in the flash message by making sure that the flash message is of class String before outputting it, like you suggested. That worked like a charm.

I'll play around some more on my other app to try to isolate the issue with the login despite lack of confirmation.

@josevalim
Copy link
Contributor

Ok, please let us know when you find something!

@greenplastik
Copy link
Author

So I finally figured out what the issue was, and it was something obvious and not having to do with Devise (which now works wonderfully). We transitioned our app from Authlogic, and during the constant branching and testing to get things to work as we transitioned, we never removed the old UserController, which must have caused some problems.

By the way, have you guys ever considered allowing people to create their own RegistrationsController, which inherits from the one in your gem. In case they want to overwrite some things. Or does that already work?

@coder2000
Copy link

That is available in 1.1 for Rails 3

@greenplastik
Copy link
Author

See? Now I have to upgrade all my apps to Rails 3. shakes fist

@coder2000
Copy link

You could just not use the one in devise and create your own anyway

@mcdba
Copy link

mcdba commented Apr 20, 2010

Confirm this bug

Ruby: 1.8.7 (p249)
Rails: 2.3.5
Devise (gem): 1.0.6

devise :registerable, :database_authenticatable, :confirmable, ....

When user sign_up correct email with confirmation url send to email,
but ueser without confirmation is logged !

when user log_out its may login again without any confirmation steps via emai

Also confirm bug with word TRUE in output before flash on root page ( after sucsessfuly sign_up with confirmable set on)
see html output

true
<< this is BUG
You have signed up successfully.

@marzdrel
Copy link

Confirmation on the flash/true bug. Rails 2.3.8, Ruby 1.8.7, Devise 1.0.6

@carlosantoniodasilva
Copy link
Member

You can check if the flash message is a string before showing up in your views.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants