devise_invitable icon indicating copy to clipboard operation
devise_invitable copied to clipboard

Invitable strategy not allowing a user to log in

Open igrabes opened this issue 11 years ago • 4 comments
trafficstars

While I have the :invitable strategy defined on my User model, one user ( I have tested 3 or 4) is unable to login and it returns a 401 (invalid email or password) . This is the stack trace:

Started POST "/users/login" for 127.0.0.1 at 2014-09-27 10:17:51 -0400
Processing by SessionsController#create as HTML
Parameters: {"utf8"=>"✓",          "authenticity_token"=>"dfiDWn0KCNudoLlGO6a+VUMKagE4XMkitFd4zQuSymI=", "user"=>          {"email"=>"[email protected]", "password"=>"[FILTERED]"}, "button"=>""}
************REQUEST path /users/login
User Load (4.2ms)  SELECT  "users".* FROM "users"  WHERE "users"."email" = '[email protected]'  ORDER BY "users"."id" ASC LIMIT 1
Completed 401 Unauthorized in 8ms

If I remove the :invitable strategy I am able to login fine.

I'm on rails (4.1.0), devise (3.2.4), devise_invitable (1.3.6) and ruby 2.1

igrabes avatar Sep 27 '14 14:09 igrabes

Check if that user has an invitation active (invitation_token present)

scambra avatar Sep 29 '14 12:09 scambra

Not sure if this helps

This was happening to me as well, I was using user.accept_invitation manually So had to manually remove the param[:user][:invitation_token] Otherwise it overwrites the invitation_token in the user object causing this issue.

rahult avatar Oct 09 '14 12:10 rahult

@scambra I am having this same issue, (invitation_token is nil, for the user)

luiskhernandez avatar Oct 01 '15 22:10 luiskhernandez

A test or sample app with instructions to reproduce would be needed to fix this

scambra avatar Oct 02 '15 08:10 scambra