volto icon indicating copy to clipboard operation
volto copied to clipboard

Wrong login credentials not showing errors on 401 error

Open giuliaghisini opened this issue 3 months ago • 10 comments

Describe the bug When trying to login with wrong credentials, and backend responds with 401 - unauthorized, no errors are shown and loader on submit login doesn't disappear.

To Reproduce Steps to reproduce the behavior:

  1. Go to '/login.'
  2. Insert wrong credentials
  3. Press login button
  4. See error: loader is still loading and no error are displayed

Expected behavior Display error and remove laoder on submit button.

Software (please complete the following information):

  • OS: MAc
  • Browser: Chrom
  • Volto Version [e.g. 18.25.0]
  • Plone Version [e.g. 6.1.0]
  • Plone REST API Version [e.g. 9.1.0]

Additional context I think the problem is in middleware/api.js when handling error (line ~310). In that moment, isHydrating is true, because it becomes false only when you have a positive response, and hasExistingError consider only content action, but here we are in a static view (/login) not related to any content, so it returns and not handles errors.

Another problem i think there's in this error handling, is that config.settings.actions_raising_api_errors doesn't contains action LOGIN

@sneridagh the error was introduced here https://github.com/plone/volto/pull/7192/files#diff-01d7617436701d779414389f02f43b75a948e31334e862f240ff8c3b6f45e82b

giuliaghisini avatar Sep 24 '25 09:09 giuliaghisini

Image

unable to reproduce this issue

Paulie-Aditya avatar Sep 24 '25 19:09 Paulie-Aditya

Image unable to reproduce this issue

if you try on demo.plone.org it works because it's using an older version of volto. It happens in volto 18.25.0

giuliaghisini avatar Sep 25 '25 07:09 giuliaghisini

demo.plone.org now has votlo 18.27.3 and I can reproduce this.

davisagli avatar Oct 07 '25 23:10 davisagli

@davisagli I would like to claim this issue, please let me know if someone is already working on it.

mayankgul avatar Oct 28 '25 17:10 mayankgul

@mayankgul This is probably not a great first issue, it's one of the more complicated parts of Volto.

davisagli avatar Oct 29 '25 02:10 davisagli

Hey @davisagli,

Before writing to you, I researched in the repo and tried to follow the workflow of login(), from Login.tsx and getting back to it, Totally agree that is somewhat complicated as we have to see why the response object is not triggering the toast.

I have some fixes, very eager to apply and test.

See, I could work on this issue.

regards,

0xarg avatar Nov 01 '25 09:11 0xarg

Is Currently someone working on this issue?

piyusshkumar avatar Nov 14 '25 12:11 piyusshkumar

@piyusshkumar please read and follow First-time contributors, especially Things not to do, Contributing to Plone, and Contributing to Volto.

stevepiercy avatar Nov 14 '25 20:11 stevepiercy

@giuliaghisini @stevepiercy @aryan7081 I can no longer reproduce this problem on the main branch. Can you confirm this?

wesleybl avatar Dec 13 '25 15:12 wesleybl

I can't reproduce it on https://demo.plone.org/login?return_url= or on https://volto.demo.plone.org/login?return_url=, both of which use Volto 18.27.3. I don't know about the main branch.

stevepiercy avatar Dec 13 '25 20:12 stevepiercy

@stevepiercy @wesleybl I'm able to reproduce this. Please see the attached Recording.

https://github.com/user-attachments/assets/00b400c4-4da9-438a-be4c-78328c3364b6

Thanks!

aryan7081 avatar Dec 14 '25 10:12 aryan7081

Please post the recording in the issue, not on Google Drive.

stevepiercy avatar Dec 14 '25 11:12 stevepiercy

@stevepiercy, Sorry for adding the drive link. I have posted the recording and removed the drive link. Please see https://github.com/plone/volto/issues/7397#issuecomment-3650683266

aryan7081 avatar Dec 14 '25 20:12 aryan7081

I tried again in private/icognito windows, and now I can reproduce it. But then, after I login, then logout in that same window, I can't reproduce it.

stevepiercy avatar Dec 14 '25 22:12 stevepiercy

@stevepiercy @aryan7081 Okay. In an incognito window, I can reproduce both at https://demo.plone.org and on the main branch.

wesleybl avatar Dec 15 '25 12:12 wesleybl

This problem only occurs when /login is loaded via SSR.

wesleybl avatar Dec 16 '25 15:12 wesleybl