Skip to content

A user who sets their locale will change the entire authentik runtime language. #12088

@j-z10

Description

@j-z10

Describe the bug

  • In Authentik, the root.settings.py file is set with Language=en.
  • User A has the attribute settings.locale = pt-PT.
  • User B does not have a specified locale.

When User A logs in, the language will change to pt-PT. This behavior appears to be caused by the ImpersonateMiddleware, which activates the locale, but does not deactivate it when the request is finished. I believe there is a risk at BrandMiddleware too

Maybe we should use it like with translation.override(locale), just as the same as the EmailMessage does

To Reproduce
Steps to reproduce the behavior:

  1. User A visits the /if/flow/default-authentication-flow/ and then signs in.
  2. User B visits the same authentication page, and the "Log in" button will be translated to "Iniciar sessão".

Expected behavior
User A shouldn't change the Authentik runtime Language, and User B should still see the "Log in" string.

Version and Deployment (please complete the following information):

  • authentik version: [e.g. 2024.10.0]
  • Deployment: [docker-compose]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions