0
votes

I am using devise_invitable in my application to invite users

https://github.com/scambra/devise_invitable

Using above plugin whenever any user is invited then that user is added in database. User can accept invitation sent in mail and login into application.

Now, we have one more scenario in our application wherein invited user can also directly register into application with out accepting invitation.

When invited user tries to sign up into application, then validation message "User already exists" is thrown as user is already added in users table.

Can anyone please suggest best solution to allow invited user to register into application.

1

1 Answers

0
votes

I don't know devise_invitable, but I think that you just have to override your Devise Controller, so that before trying to create an User, it will test its existence, and if the user has been added to the database but has never signed-in, you update its password and create a session instead of trying to create a new user with the same email !