enriclluelles/route_translator

session not working with rack 2.2.3

seb-sykio opened this issue · 3 comments

hi,
no pb with 2.2.2, but if I update to 2.2.3, session are not working anymore.
devise successfully log in the user, then redirect him, but then it is not authorized to access page
if I go back to rack 2.2.2, then it works correctly

Started POST "/fr/connexion" for 127.0.0.1 at 2020-07-11 19:56:50 +0200
Processing by SessionsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"VdSdJskxgy9ySTUrjIPiTKJG4cvO+sMus2Iem21IcsJdRzuPFZeRb3rX2wpflEdaUQ5QLpsPoUQa/KXanUuKHQ==", "user"=>{"email"=>"xxx@ccc.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "button"=>"", "locale"=>"fr"}
  User Load (11.4ms)  SELECT "users".* FROM "users" WHERE "users"."email" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["email", "xxx@ccc.com"], ["LIMIT", 1]]
   (0.3ms)  BEGIN
  User Update (2.1ms)  UPDATE "users" SET "current_sign_in_at" = $1, "last_sign_in_at" = $2, "sign_in_count" = $3, "updated_at" = $4 WHERE "users"."id" = $5  [["current_sign_in_at", "2020-07-11 17:56:50.386072"], ["last_sign_in_at", "2020-07-01 11:36:16.139109"], ["sign_in_count", 86], ["updated_at", "2020-07-11 17:56:50.386478"], ["id", 308156]]
   (2.3ms)  COMMIT
Redirected to http://0.0.0.0:3000/fr
Completed 302 Found in 112ms (ActiveRecord: 20.5ms | Allocations: 11592)


Started GET "/fr" for 127.0.0.1 at 2020-07-11 19:56:50 +0200
Processing by AdsController#index as HTML
  Parameters: {"locale"=>"fr"}
Completed 401 Unauthorized in 1ms (ActiveRecord: 0.0ms | Allocations: 544)

tested with
ruby 2.7.1 and 2.6.6
rails 6.0.3.2
devise 4.7.2

I created an issue on Rack rack/rack#1682
and they said it might be linked with route_translator
anyone else having same issue ?

thanks

Hi,

thanks for being part of the Route Translator community

Quoting from the original issue on rack:

Are you using cookies with names that need URL escaping?

Route Translator does not use cookies.

I took a brief look at rack/rack@5ccca47 and it is not clear to me how that change could affect route_translator

Could you please try without authentication?

If you can't, please provide a reproducible test case with the minimum amount of code needed (rails / devise / route_translator) so I can take a deeper look

thanks for your answer.

@seb-sykio did you solve this?