Closed pferrariuy closed 3 months ago
Created property solarec.service.custom_flow
, if empty then tech.renovus.solarec.business.impl.DefaultCustomFlow
will be use.
In order to use a custom flow code, the property must set a value and the implementation must add the @ConditionalOnProperty(name = "solarec.service.custom_flow", havingValue = "xxxxx")
.
The tech.renovus.solarec.business.CustomFlowInterface
allows the following customizations:
public boolean afterAuthentication(Authentication authentication, UserData userData)
: user has been authenticated, user and client informatio loaded (location not loaded), ideal for addional steps like MFA.public void beforeSendingToHomepage(UserData userData)
: user has been authenticated, all required objects had been loaed, if available. Ideal for custom controls of data and request addional information, by setting custom error codes / messages.public void beforeLogOut(UserData userData)
: user has not ben logout yet, all information is present, ieal for addional logout messages.Added to UserData
property authenticationErrorMessage
to allow custom error messages.
Description
The idea is to enable custom flows of the interactions beteween the front and backend in different parts of the system. By default, the solution will execute a standar flow, allowing in different parts the possibility to call a service, that will determinate if the flow must continue or must be stoped and send a response to the frontend.
Expected Behavior
By default the flow wil lbe as defined, but depending on certain events (after login, after logout, etc.) a method will be code (like an API) with different information and can return updated information that will determinate if the flow must continue or the result must be send to the frontend.
Additional Context
These will allow to customize the solution without the need of changing code of the Renovus solution; allowing other solutions to add customized code in the current flow.
Implementation Suggestions