Auth0 Home Blog Docs

Duplicate IDs in Lock



In HTML, IDs are meant to be unique. When they are not unique, selecting elements by ID can become non-deterministic, resulting in strange errors depending on browser. I see the following IDs on the login page being duplicated (I list them in the order that my code noticed them):

Page-1, Lock, SMS, Group, Shape, Page-1, Lock, SMS, Group, Shape


Thanks for calling the attention to this situation, as you mentioned, having duplicated identifiers and then performing programmatic access on them is indeed likely to cause issues. When there’s no programmatic access the situation is less of a concern, although the specification still does point to the fact that identifiers should be unique.

From a quick look at the situation I was indeed able to reproduce some of the duplicate identifiers and they seem to be associated with SVG’s that are not subject to programmatic access. Having said that, if you experienced issues deriving from the duplicate identifiers I would recommend you to raise this situation in the Lock repository.