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

Users are being logged in as the wrong user #5740

Open
x9sim9 opened this issue Dec 12, 2024 · 0 comments
Open

Users are being logged in as the wrong user #5740

x9sim9 opened this issue Dec 12, 2024 · 0 comments

Comments

@x9sim9
Copy link

x9sim9 commented Dec 12, 2024

Hi We are having a really strange issue with devise for some reason a user is using 1 set of credentials and being randomly logged in as another user. The issue happens intermittently and we have started saving the email address used when logging in and comparing it to the current_user being reported from devise and forcing a logout when this happens.

We don't have a reliable way of recreating the issue, it seems to happen randomly but we have about 20 rollbar error reports so we do have some information, not sure what information to provide

Environment

  • Ruby 3.3.5
  • Rails 7.1.4.2
  • Devise 4.9.4

Current behavior

User is being logged in as the wrong user

Expected behavior

User should be logged in as the correct user

What we have tried

Using database session storage and redis session storage, here is the current config

Rails.application.config.session_store :redis_store,
url: "#{ENV.fetch("REDIS_URL", "redis://127.0.0.1:6379/0")}/session",
expire_after: 30.days,
key: Rails.env.production? ? "_new_app_session" : "new_app_session#{Rails.env}",
threadsafe: true,
secure: Rails.env.production?,
same_site: :lax,
httponly: true,
domain: :all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant