inveniosoftware / invenio-oauthclient

Invenio module that provides OAuth web authorization support.
https://invenio-oauthclient.readthedocs.io
MIT License
6 stars 76 forks source link

handlers: report errors on signup #278

Closed ppanero closed 2 years ago

ppanero commented 2 years ago

The final result with all possible errors triggered:

Screenshot 2022-05-20 at 12 02 03

An ideal and more consistent solution would be similar to the following. However, the problem is that profile is a single field (with three inner ones: username, full_name and affiliations). No way to forward the errors from render_field to the actual field rendering (L46) was found. The local form (coming form invenio-userprofiles) can do that becuase it renders fields explicitly (i.e. not in a for loop) and the are no field with inner fields in the form.

Screenshot 2022-05-20 at 10 58 22

ppanero commented 2 years ago

Status

This PR is blocked because the CSRF token is not getting into the form (and therefore it does not validate, and cant login with contribs). Things tested:

slint commented 2 years ago

In the end, there was probably some copy-paste issue with the Jinja macro, since the line that renders hidden form fields was removed (leaving an "empty" if statement clause in Jinja). The CSRF field is now properly rendered and validates when the form is submitted.