kylecorbelli / redux-token-auth

Redux actions and reducers to integrate easily with Devise Token Auth
MIT License
154 stars 80 forks source link

`Missing 'confirm_success_url' parameter.` when registering user from backend devise_token_auth #24

Open DonGiulio opened 6 years ago

DonGiulio commented 6 years ago

I'm getting this error when registering a new user,

here's my signUp function:

const signUp = (data, dispatch, props) => {
  data["confirm_success_url"] = props.match.url.replace("/signup", "");
  data["uid"] = data.email;
  dispatch(registerUser(data));
};

as called <form onSubmit={props.handleSubmit(signUp)}>

and these are the parameters received by my devise_token_auth action:

<ActionController::Parameters {"email"=>"a@B.c", "password"=>"pwd", "password_confirmation"=>"pwd", "controller"=>"auth/registrations", "action"=>"create", "registration"=>{"email"=>"a@B.c", "password"=>"pwd", "password_confirmation"=>"pwd"}} permitted: false>

no traces of any of the extra data fields I added: confirm_success_url, uid.

They seem to be required by devise_token_auth

Is it possible I'm doing something wrong there?

thanks, Giulio

peterlawless commented 6 years ago

Hey @DonGiulio I don't see the details of your error and you have likely moved on by now but two things you might attempt: 1) attempt setting default_confirm_success_url in the config/initializers/devise_token_auth.rb file on your rails app (see more initializer options here) 2) This issue brought to my attention that the mailer views generated by devise_token_auth are a little different than those generated by classic devise, so you may want to run rails generate devise_token_auth:install_views so that the link in your confirmation email works with your confirmation success url.

maysam commented 3 years ago

do you have include DeviseTokenAuth::Concerns::User inserted in your user model?