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

Expected params don't match Devise itself #233

Closed
pupeno opened this issue May 3, 2015 · 3 comments
Closed

Expected params don't match Devise itself #233

pupeno opened this issue May 3, 2015 · 3 comments

Comments

@pupeno
Copy link

pupeno commented May 3, 2015

Hello,

First, my apologies if this report is wrong. I'm new to token auth and javascript frameworks. ember-simple-auth-devise sends the params mimicking devise itself, so that rails receives:

{"user"=>{"email" => "[email protected]",
                "password"=>"supersecret"},
 "controller"=>"sessions",
 "action"=>"create"}"

but apparently devise_token_auth expects:

{"email" => "[email protected]",
 "password"=>"supersecret",
 "controller"=>"sessions",
 "action"=>"create"}"
@colindensem
Copy link

Hopefully long since resolved for you.
For reference this is how I overcame it.

//app/authenticators/devise.js
import DeviseAuthenticator from 'ember-simple-auth/authenticators/devise';
export default DeviseAuthenticator.extend({
  serverTokenEndpoint: '/auth/sign_in',
  resourceName: '',
});

@zachfeldman
Copy link
Contributor

Seems like this one is solved.

@MichalBryxi
Copy link

MichalBryxi commented May 28, 2020

Seems like the solution only applies to older version of ember-simple-auth. I raised an issue with ember-simple-auth here. Cross linking to make sure people are not confused.

Some workaround for this sort of problem on devise_token_auth would be nice though.

Would it be possible to add support for a root key? i.e:

{ 
  user: { 
    email: 'xxx', 
    password: 'yyy' 
  } 
}

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

4 participants