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 #328

Closed
W0lfbane opened this issue Aug 6, 2015 · 3 comments
Closed

Unpermitted parameters: format, session #328

W0lfbane opened this issue Aug 6, 2015 · 3 comments

Comments

@W0lfbane
Copy link

W0lfbane commented Aug 6, 2015

Hi all, I'm sorry if I sound super noobish. I'm having a bit of a weird console warning/error. Firstly, I'm following this tutorial: https://www.airpair.com/ruby-on-rails/posts/authentication-with-angularjs-and-ruby-on-rails

I've completed to step 4.2. The sign in and sign out works without an issue, however on the console I'm getting this:

Started POST "/api/auth/sign_in" for 54.244.121.10 at 2015-08-06 16:31:49 +0000
Cannot render console from 54.244.121.10! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by DeviseTokenAuth::SessionsController#create as JSON
Parameters: {"email"=>"[email protected]", "password"=>"[FILTERED]", "session"=>{"email"=>"[email protected]", "password"=>"[FILTERED]"}}
Unpermitted parameters: format, session
Unpermitted parameters: format, session
Unpermitted parameters: format, session
User Load (0.2ms)  SELECT  "users".* FROM "users" WHERE (email = '[email protected]' AND provider='email')  ORDER BY "users"."id" ASC LIMIT 1
Unpermitted parameters: format, session
Unpermitted parameters: format, session
(0.1ms)  begin transaction
SQL (1.0ms)  UPDATE "users" SET "tokens" = ?, "updated_at" = ? WHERE "users"."id" = ?  [["tokens", "{\"GiEBErwwZa76Qb0imfoNBQ\":{\"token\":\"$2a$10$irR2EbAwiFAFSYPcc7twIelV2dbkUlrieU8d/GoER1hUz6H3ZpcaK\",\"expiry\":1440027291,\"last_token\":\"$2a$10$kh/W1j43AoyHf4vYaedkxu8mOkF8KHipX9WlxXOcEirGWlU1GJiya\",\"updated_at\":\"2015-08-05T23:34:51.403+00:00\"},\"n9VELE-DDNW0wv7Ix5PJCQ\":{\"token\":\"$2a$10$b0qOlDiz03oKNJTDiyFdvO8IrS2XgN6o8vlQ5dsV0pVFhSdyUank.\",\"expiry\":1440031127,\"last_token\":\"$2a$10$/8tuyKFQofaVObcIE089X.D.kIjmZvhCeJ4NvyF8cS8KF/MIwlSGe\",\"updated_at\":\"2015-08-06T00:38:47.305+00:00\"},\"phC6p7yqsr6B8t8tcVQs5Q\":{\"token\":\"$2a$10$8J1ln1FtzewB.BtJtVX.2uo5XtNnOAGHu7.55h4x.yFFP6PJ2IT9G\",\"expiry\":1440088309}}"], ["updated_at", "2015-08-06 16:31:49.496777"], ["id", 1]]
(6.1ms)  commit transaction
(0.1ms)  begin transaction
SQL (0.2ms)  UPDATE "users" SET "last_sign_in_at" = ?, "current_sign_in_at" = ?, "sign_in_count" = ?, "updated_at" = ? WHERE "users"."id" = ?  [["last_sign_in_at", "2015-08-06 00:41:04.594986"], ["current_sign_in_at", "2015-08-06 16:31:49.516828"], ["sign_in_count", 6], ["updated_at", "2015-08-06 16:31:49.518366"], ["id", 1]
(7.4ms)  commit transaction
(0.0ms)  begin transaction
User Load (0.2ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1   [["id", 1]]
SQL (0.2ms)  UPDATE "users" SET "tokens" = ?, "updated_at" = ? WHERE "users"."id" = ?  [["tokens", "{\"GiEBErwwZa76Qb0imfoNBQ\":{\"token\":\"$2a$10$irR2EbAwiFAFSYPcc7twIelV2dbkUlrieU8d/GoER1hUz6H3ZpcaK\",\"expiry\":1440027291,\"last_token\":\"$2a$10$kh/W1j43AoyHf4vYaedkxu8mOkF8KHipX9WlxXOcEirGWlU1GJiya\",\"updated_at\":\"2015-08-05T23:34:51.403+00:00\"},\"n9VELE-DDNW0wv7Ix5PJCQ\":{\"token\":\"$2a$10$b0qOlDiz03oKNJTDiyFdvO8IrS2XgN6o8vlQ5dsV0pVFhSdyUank.\",\"expiry\":1440031127,\"last_token\":\"$2a$10$/8tuyKFQofaVObcIE089X.D.kIjmZvhCeJ4NvyF8cS8KF/MIwlSGe\",\"updated_at\":\"2015-08-06T00:38:47.305+00:00\"},\"phC6p7yqsr6B8t8tcVQs5Q\":{\"token\":\"$2a$10$LecZu7VzgGxBoOUOVAWU2e27yq8UCvZni1ZAtidauxVuTtQHVgjmC\",\"expiry\":1440088309,\"last_token\":\"$2a$10$8J1ln1FtzewB.BtJtVX.2uo5XtNnOAGHu7.55h4x.yFFP6PJ2IT9G\",\"updated_at\":\"2015-08-06T16:31:49.602+00:00\"}}"], ["updated_at", "2015-08-06 16:31:49.603345"], ["id", 1]]
(8.5ms)  commit transaction
Completed 200 OK in 289ms (Views: 0.3ms | ActiveRecord: 24.7ms)

I'm able to get rid of the "format" unpermitted param by adding it as a permitted parameter as explained here: https://github.com/plataformatec/devise#strong-parameters
Doing this with "session" however does not work.

I guess to start, what is "format" and why does it not show in the transaction? And secondly, is there any way I can get rid of "session" from the transaction, or at least allow it as a permitted parameter? (Because if I remember correctly, the session param is actually default rails behavior)

@abhayastudios
Copy link

Seems similar to #130 or in short: it is ok that session is unpermitted. Format is probably the json or html format from your rails controller.

@W0lfbane
Copy link
Author

W0lfbane commented Sep 1, 2015

Any idea how I can tell the devise_auth::sessionscontroller#create to accept format? It's not a huge deal since it doesn't seem to be causing any issues, but the warnings can get a little annoying sometimes.

@W0lfbane
Copy link
Author

W0lfbane commented Sep 1, 2015

I suppose I can close this since there does not seem to be an issue.

@W0lfbane W0lfbane closed this as completed Sep 1, 2015
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

2 participants