influitive / apartment

Database multi-tenancy for Rack (and Rails) applications
2.67k stars 463 forks source link

Devise doesn't play well with Apartment after password failure #542

Closed vronin closed 6 years ago

vronin commented 6 years ago

Environment

Current behavior

I am pretty sure that everybody know about apartment gem. However, for completeness sake, apartment gem (https://github.com/influitive/apartment) provides multitenancy for Rails and ActiveRecord.

I am using both devise and apartment gem. They play nicely with each other. However, I just stumbled on one use case, when they don't.

1) I open a sign in page

2) I enter a password and click Sign in

3) The password is incorrect

vronin commented 6 years ago

I have no idea whether it's a devise or apartment problem. It feels like devise issue. However, let me cross reference this issue raised in both gems: https://github.com/plataformatec/devise/issues/4835

abartier commented 6 years ago

Hi,

I'm running the same versions as you except for pg (9.6). And I can't reproduce what you're seeing. I remember that their are few things to do to play nice with Devise and Apartment have you check those:

Maybe you'll find something, your issue remind me the #340

vronin commented 6 years ago

@abartier Yes. The issue end up being the order of middleware. Closing it. Thanks.