Skip to content

2FA input field does not ignore non visible characters (whitespace) #28396

@cjaone

Description

@cjaone

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

When the 2FA code is entered with whitespace, for example "123456 " then the code is not accepted.

Describe the behavior you expected

I expected that non visible characters are not treated as a part of the 2FA code.

Steps to reproduce the issue

  1. Successfully log in to the HA instance with user name and password
  2. Enter the 2FA code with a trailing space
  3. Enter the 2FA code without space
    ...

What version of Home Assistant Core has the issue?

2025.10.3

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue?

Firefox

Which operating system are you using to run this browser?

Linux, also happend with the Android Companion App

State of relevant entities

Problem-relevant frontend configuration

JavaScript errors shown in your browser console/inspector

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions