-
Notifications
You must be signed in to change notification settings - Fork 233
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
Rails - Unpermitted parameters #49
Comments
Hi @m2omou, the "unpermitted parameters" message is expected, and it's harmless. Is everything else working ok? |
Oh ok ! :) No that doesn't work, as you can see in my logs I got a: rollback transaction So the registration fail, the user is not created in the database. Any idea ? |
Maybe this has something to do with the fact that I recently moved from Rails 3 to Rails 4 ? Or Maybe OmniAuth or Devise gem not well configured ? |
Ok found my error ! -_-' "errors": [ Because I used the template registration in the doc, and apparently "confirm_success_url" wan't included. Got it now, thanks @lynndylanhurley, again great job. |
@m2omou - cool, I'm glad everything worked out. The |
This is the registration form that I use, I took it from the doc example. And I'm using chrome.
|
Yes you're right, confirm_success_url is sent by default by the browser. I've done the manipulation again and now it works, weird.. haha However, when I send the parameter "nickname", the user is created but nickname is null ? Can I modify the controller in order to accept nickname in the registration ? Unpermitted parameters: confirm_success_url, nickname |
@m2omou - see the Devise section on strong params. This gem inherits that functionality. |
I'm experiencing the same issue, and haven't been able to resolve it, I'm unclear as to what the solution here is. |
@milos89 - can you explain your issue exactly? Please include:
|
Okay. The issue is exactly the same as @m2omou had. This is server output:
This is registration form: <form ng-submit="registerUser()">
<div class="form-group col-md-6 col-md-offset-3">
<label for="keywords" class="sr-only">Email</label>
<input ng-model="user.email" type="text" autofocus class="form-control" required="required" placeholder="[email protected]">
</div>
<div class="form-group col-md-6 col-md-offset-3">
<label for="keywords" class="sr-only">Password</label>
<input ng-model="user.password" type="password" class="form-control" required="required" placeholder="Password">
</div>
<div class="form-group col-md-6 col-md-offset-3">
<label for="keywords" class="sr-only">Password Confirmation</label>
<input ng-model="user.password_confirmation" type="password" class="form-control" required="required" placeholder="Password Confirmation">
</div>
<div class="form-group col-md-6 col-md-offset-3 text-center">
<button type="submit" class="btn btn-primary btn-lg">Register</button>
</div>
</form> I'm using rails 4.2, and newest versions of ng-token-auth, devise-token-auth and angular (just installed them using bower). Thanks. |
I think I have probably messed up configuration on the server side, but this issue seemed to look the most to mine, and @m2mout seems to have resolved it. |
This could be the problem: Try setting class ApplicationController < ActionController::Base
protect_from_forgery with: :null_session
include DeviseTokenAuth::Concerns::SetUserByToken
# ...
end |
Didn't work. Don't have time to work this out today, but thanks for the help and the great work you have done on this plugin. Will post here if I resolve my issue. |
@milos89 - please provide the following:
These can be found in the network tab of your browser's web inspector. |
Found what was wrong. Turns out my password was too short. I must have missed that in the console. Sorry for reopening this issue for my stupidity, and thanks a lot. |
Hi, Since I am not using a browser, I don't see how that can be set. Could you please tell me how to signup a user from curl request. Since the front end of my application is not rails, I cannot use views of devise and have to resolve to provide apis for all the user management related requests. Thanks. |
Did you try passing any value as confirm_success_url? |
This worked for me: |
Thanks guys for quick response. I tried using confirm_success_url as part of my post request data along with email, password and password_confirmation. also I added it to devise_parameter_sanitizer for sign up. I got following error: Started POST "/auth" for 10.0.2.2 at 2015-03-23 07:11:47 +0000 NameError (undefined local variable or method `confirm_success_url=' for #User:0x00000002899c00): I have tried using curl request format mentioned above by @jfields and postman chrome extension |
Finally got it working. Here is what I did:
|
having the same issue here as well. since unpermitted parameters aint the problem. can someone help me out with how to solve this? Started POST "/api/auth" for 127.0.0.1 at 2015-04-14 21:47:05 +0800 Unpermitted parameters: confirm_success_url, config_name, registration my routes.rb my usersessions.js $scope.handleRegBtnClick = function() { |
@boyfunky |
@vikashvikram I just don't understand how to go about step 2 of your last post listing 3 steps that fixed the problem for you. Could you explain how to go about "2) removed confirm_success_url from deserializer block in application controller"? Do you mean removing it from the devise_parameter_sanitizer? Thanks. |
Ok. I updated the gem to - gem "devise_token_auth", ">= 0.1.32.beta9" and success... I can get registration working and an email confirmation sent... if in devise_token_auth.rb I set - config.default_confirm_success_url = "confirmed" However - including confirm_success_url as a parameter in the POST throws the same error as always - "unknown attribute 'confirm_success_url" and a "Completed 500 Internal Server Error" in the development.log. I guess I will just have to stick to this setup. |
…ck_too_permissive fix(expiry): fix an issue where token expiration checks were too permissive
I had same issue as @ericgaut . After checking this on clear application (it worked like need), I understood that problem in my application behavior. In the end problem was in custom errors interrupter on application controller level. It broken standard Rails behavior, and cause this errors. I can be something like this:
|
Hi,
and response JSON:
So, if i want sign in with something other than their email address???? Thanks |
Sorry,
|
Hi, I'm trying to use ng-token-auth with devise_token_auth gem.
I got a problem when trying to register with angulajs. I got these two line:
Unpermitted parameters: confirm_success_url, config_name, registration
Unpermitted parameters: confirm_success_url, config_name, registration
Any idea ?
This is the logs :
Started POST "/auth" for 127.0.0.1 at 2014-10-15 14:17:57 +0200
Processing by DeviseTokenAuth::RegistrationsController#create as HTML
Parameters: {"email"=>"[email protected]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "confirm_success_url"=>"http://localhost:3000/", "config_name"=>"default", "registration"=>{"email"=>"[email protected]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "confirm_success_url"=>"http://localhost:3000/", "config_name"=>"default"}}
Unpermitted parameters: confirm_success_url, config_name, registration
Unpermitted parameters: confirm_success_url, config_name, registration
(0.1ms) begin transaction
(0.3ms) SELECT COUNT(*) FROM "users" WHERE "users"."provider" = 'email' AND "users"."email" = '[email protected]'
User Exists (0.3ms) SELECT 1 AS one FROM "users" WHERE LOWER("users"."email") = LOWER('[email protected]') LIMIT 1
(0.1ms) rollback transaction
Completed 403 Forbidden in 309ms (Views: 1.3ms | ActiveRecord: 6.4ms)
Thanks for your work.
The text was updated successfully, but these errors were encountered: