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

[Duplicate] is devise_invitable supported? #154

Closed
ghost opened this issue Feb 17, 2015 · 0 comments
Closed

[Duplicate] is devise_invitable supported? #154

ghost opened this issue Feb 17, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Feb 17, 2015

I am trying to use devise_invitable(1.4.0) gem with devise_token_auth(0.1.31)/devise(3.4.1) but having an issue. When I make a post request to auth/invitation the following error occurs

ArgumentError in Devise::InvitationsController#create
wrong number of arguments (1 for 0)

Extracted source (around line #102):
101        class_eval <<-METHODS, __FILE__, __LINE__ + 1
102          def authenticate_#{mapping}!
103            unless current_#{mapping}
104              return render json: {
105                errors: ["Authorized users only."]

Trace:
devise_token_auth (0.1.31) lib/devise_token_auth/controllers/helpers.rb:102:in `authenticate_user!'
devise_invitable (1.4.0) lib/devise_invitable/controllers/helpers.rb:18:in `authenticate_inviter!'
devise_invitable (1.4.0) app/controllers/devise/invitations_controller.rb:69:in `current_inviter'
devise_invitable (1.4.0) app/controllers/devise/invitations_controller.rb:73:in `has_invitations_left?'

First I setup devise_token_auth and is working perfectly. Now I am adding devise_invitable as follows:

  1. Passed parameter :invitable in user model devise method
  2. Executed migraton to add devise_invitable columns

that's it, running rake routes shows me that devise_token_auth is creating routes for invitation. But they are showing me above posted error.

Is devise_invitable is supported by devise_token_auth? Is there a way to use them together?

@ghost ghost closed this as completed Feb 17, 2015
@ghost ghost changed the title is devise_invitable supported? [Duplicate] is devise_invitable supported? Feb 17, 2015
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
Projects
None yet
Development

No branches or pull requests

0 participants