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

Unpermitted parameters: format, session, lang #239

Closed
andreareginato opened this issue May 11, 2015 · 1 comment
Closed

Unpermitted parameters: format, session, lang #239

andreareginato opened this issue May 11, 2015 · 1 comment

Comments

@andreareginato
Copy link

Hi there.

It'a one day I'm trying to solve this issue, so I thought this could be the place where to talk about my problem. Any help would be lovely appreciated.

I can tell by the beginning that I'm not including the user concern, because it gives some problems using Mongoid. So, if this is the reason of the problem, I'm sorry for bothering you

include DeviseTokenAuth::Concerns::User

That said, the error I'm having is the following.

INFO -- : Started POST "/api/v1/auth/sign_in" for 127.0.0.1 at 2015-05-11 12:22:00 +0200
INFO -- : Processing by DeviseTokenAuth::SessionsController#create as JSON
INFO -- : Parameters: {"email"=>"[email protected]", "password"=>"[FILTERED]", "session"=>{"email"=>"[email protected]", "password"=>"[FILTERED]"}}
DEBUG -- : Unpermitted parameters: format, session, lang
INFO -- : Completed 500 Internal Server Error in 50ms

I tried different solutions and now I'm trying to add some code that should enable the integration between mongoid and devise_token_auth, but in the meantime I wanted to ask you.

Here my configuration settings. I'm using ruby 1.9.3 and Rails 4.2.1.

Installed gems

Using devise 3.4.1
Using devise_token_auth 0.1.32.beta9

Routes definition

# standard devise routes available at /users
devise_for :users, controllers: {
  registrations: 'users/registrations',
  omniauth_callbacks: 'users/omniauth_callbacks' }

#standard devise routes available at /users
devise_scope :user do
  get 'profile' => 'users/registrations#profile'
end

# token auth routes available at /api/v1/auth
namespace :api, defaults: { format: 'json' } do
  scope :v1 do
    mount_devise_token_auth_for 'User', at: 'auth'
  end
end

Application controller definition

class ApplicationController < ActionController::Base
  include DeviseTokenAuth::Concerns::SetUserByToken
  skip_before_filter :verify_authenticity_token

Thanks a lot for your time.

@andreareginato
Copy link
Author

I solved the issue. Of course I had to add the include DeviseTokenAuth::Concerns::User concern, and then to make the gem working with Mongoid I used a fork of the devise_token_auth gem.

gem 'devise_token_auth', git: 'https://github.com/ybian/devise_token_auth.git', branch: 'mongoid'

Also. I suggest to checkout the user model @ybian defined as it could be helpful to solve further problems you could find out.

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

1 participant