ruby on rails - Omniauth with Devise - Handling invitation scenarios -
i'm integrating omniauth , devise first ever ruby on rails application. working google.
it works, , love all. can register clicking link in app, authenticating in google, redirecting back... expected.
i need support current user inviting new users work on projects together. this, allow current user create new user row, specifying email address of new user. row added stub, work can assigned new user.
i expect new user register @ point after clicking google link in app, authenticating in google, redirecting app.
when happens, error:
1 error prohibited user being saved: email has been taken
i understand why, i'm struggling trying find correct hooks can & should use change behavior allow registering user take on stubbed user row created him.
edit: list of relevant gems (i think):
- devise (2.2.3) - oauth (0.4.7) - oauth2 (0.8.1) - omniauth (1.1.3) - omniauth-facebook (1.4.1, 1.4.0) - omniauth-google (1.0.2) - omniauth-google-oauth2 (0.1.13) - omniauth-oauth (1.0.1) - omniauth-oauth2 (1.1.1, 1.0.3)
edit - devise modules
devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :omniauthable
self answer....
i never did find way modify behavior, put hack in. created new table hold invitations inserted when person not registered invited. first time invitee comes site, automatically accept invitations.
seems there should more elegant solution this... feel free share posterity!
Comments
Post a Comment