Opened 2 years ago

Last modified 2 years ago

#2278 closed enhancement

Improvements to login page for better extensions — at Version 5

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 3.19.3
Component: web Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

The login page can to some extents be modified by extensions but there are some improvements that can be made:

  1. The possibility to execute scripts before the login information is submitted. This could for example, be implemented as a custom event that is sent to the form before the form is submitted. Event handlers can do their processing and may also cancel the submission if needed.
  1. The possibility to add extra attributes to the login form and/or fields. We already have the DynamicActionsAttributes interface for this and it should be very easy to add support for it.
  1. The error message section should always be included in the HTML, but it should be hidden if there is no current message. Extensions should be able to display error messages.
  1. It should be possible to store session settings in the SessionControl even if a user is not logged in. This would, for example, be useful for the WebAuthn implementation (https://baseplugins.thep.lu.se/wiki/net.sf.basedb.webauthn) that need to store information between two requests.
  1. Scripts and style sheets that are added by extensions may interfere with each other. Since only one login form can be active it would be nice if only the scripts/style sheets defined by that extension are added to the page. When a different login form is selected the page is reloaded with the new scripts/style sheets.
  1. More...?

Change History (5)

comment:1 by Nicklas Nordborg, 2 years ago

In 8035:

References #2278: Improvements to login page for better extensions

Implemented a custom event before-login that is sent to the <form> element on the login page just before it is about to be submitted. Extensions may register for this event and may call event.preventDefault() to prevent the submission. A new method Login.submitLoginForm() can be called to submit the form without any more questions.

comment:2 by Nicklas Nordborg, 2 years ago

In 8036:

References #2278: Improvements to login page for better extensions

Added support for dynamic attributes to the LoginFormBean and FieldInfo classes.

comment:3 by Nicklas Nordborg, 2 years ago

In 8037:

References #2278: Improvements to login page for better extensions

Added a <div id="login-error"> that is always included in the HTML but hidden if there is no current error message.

comment:4 by Nicklas Nordborg, 2 years ago

In 8038:

References #2278: Improvements to login page for better extensions

Sessions settings are now stored directly in the SessionControl which doesn't require that a user is logged in.

comment:5 by Nicklas Nordborg, 2 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.