Registration#confirm_email is defective #102

Closed
practicingruby opened this Issue Nov 16, 2012 · 2 comments

Projects

None yet

2 participants

Owner

The second condition in the following if statement guarantees that user will be nil, which means user.clear_access_token will fail.

    user = User.find_by_access_token(params[:secret])

    if user || current_user.try(:status) == "confirmed"
      user.clear_access_token

I'd attempt a fix, but I really don't understand what this code is trying to do. Can you clarify @jordanbyron?

@jordanbyron jordanbyron was assigned Nov 16, 2012
Owner

I started working on a patch for this today. Essentially I want to make sure that if the current_user is already confirmed we move them on to the payment page. So really there should be two conditionals: one to handle the updating of the status and another just to pass through current_users. I can try to clarify a bit more if you'd like.

On Nov 16, 2012, at 6:51 PM, Gregory Brown notifications@github.com wrote:

The second condition in the following if statement guarantees that user will be nil, which means user.clear_access_token will fail.

user = User.find_by_access_token(params[:secret])

if user || current_user.try(:status) == "confirmed"
  user.clear_access_token

I'd attempt a fix, but I really don't understand what this code is trying to do. Can you clarify @jordanbyron?


Reply to this email directly or view it on GitHub.

Owner

It's a really weird edge case so I don't think a fix is urgent. If you want to keep working on your patch I'll leave it up to you, otherwise I'll probably try to fix this tomorrow. I'm emailing the affected users and will continue to do that if we see exception notifications.

Let me know what you want to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment