馃獎 Bug Fix: Added a check if redirect_on_register is allowed #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug Fix: Added a check if redirect_on_register is allowed
Issue
The method
register()
currently faces a limitation where it cannot return its output due to enforced redirection, impacting API-first applications/requests or those aiming to handle the method's return manuallyDetails of Changes
I introduced a check to see if the
REDIRECT_ON_REGISTER
configuration option is enabled. This change ensures that the redirection after user registration only occurs if explicitly allowed by the configuration.I modified the code block responsible for redirecting users after registration to include a conditional check for the
REDIRECT_ON_REGISTER
configuration option. If this option is enabled, the redirection will proceed; otherwise, there will be a return valueBenefits
Compatibility
This change does not impact any existing features or functionalities of the application. It operates within the existing framework, ensuring seamless integration with the authentication module.
Documentation Update
An update to the LeafMVC documentation is necessary to reflect the addition of the
REDIRECT_ON_REGISTER
configuration option within the authentication module. This ensures that users and developers are aware of this configurable behaviour and can utilize it effectively.