Skip to content

2FA doesn't work on different servers w/ different APP_KEY #14252

@edalzell

Description

@edalzell

Bug description

Situration:

  • users are stored in git (a common occurrence)
  • you have different environments (production/staging/local) that each have a different APP_KEY (as they should)
  • 2FA is enabled

If you set up 2FA on production, then try to login in locally, you can't because the decryption fails because the APP_KEYs are different

Ideally, one could disable the 2FA enforcement via an environment variable (like Revisions) so we could use the same users but still login locally or on staging w/o 2FA.

How to reproduce

  • set up 2 identical sites, w/ different app keys
  • enable 2FA on both
  • on site A, configure 2FA for a user
  • copy that user to Site B
  • Attempt to login using the configured 2FA

Logs

Environment

Statamic 6.6.1

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions