Skip to content

Login error toast renders empty <ul><li> even for single error #13191

@Krzyzu84

Description

@Krzyzu84

Describe the Bug

When logging in with an invalid email or password, the error toast message in the admin panel contains:

Podany adres e-mail lub hasło jest nieprawidłowe.:

In the HTML, it looks like:

<div>
  Podany adres e-mail lub hasło jest nieprawidłowe.:
  <ul data-testid="field-errors">
    <li></li>
  </ul>
</div>

This results in:

  • unnecessary colon (:)
  • empty bullet point <li>

even though only a single error message is present.

Link to the code that reproduces this issue

This happens inside PayloadCMS core and we cannot provide a public reproduction repository as our project is private. However, the issue can be reproduced using the default admin with Polish (pl) i18n enabled.

Reproduction Steps

Reproduction Steps:

  1. Go to the login page of the Payload admin panel.
  2. Enter a valid email address of an existing user.
  3. Enter an incorrect password (at least 3 characters).
  4. Click “Log in.”
  5. Observe that the error message is displayed inside an <ul><li> element, even though it’s a single-line message.

Current behavior:

  • Displays an error toast with the message and an empty
    • bullet point.
    • Adds a colon after the message (:), even though no list is needed.

    Expected behavior:

    For a single error message, render only the text, without the colon or list, e.g.:

    Podany adres e-mail lub hasło jest nieprawidłowe.

    Which area(s) are affected? (Select all that apply)

    Not sure

    Environment Info

    PayloadCMS version: v3.28.0
    

Metadata

Metadata

Assignees

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