Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent External Users Registration #17050

Merged
merged 29 commits into from
Nov 25, 2024
Merged

Conversation

MikeAlhayek
Copy link
Member

@MikeAlhayek MikeAlhayek commented Nov 23, 2024

Summary

Fix #17048
Fix #17059
Fix #16905

This PR also refines the registration and login processes to enable event-based hooks, allowing for easier customization and decoupling of code based on the enabled features. It also improves feature dependencies so code like the following is no longer needed:

var registrationFeatureIsAvailable = (await _shellFeaturesManager.GetAvailableFeaturesAsync())
                       .Any(feature => feature.Id == UserConstants.Features.UserRegistration);

// do something...

Release Notes

The user registration and login functionalities have been refactored for better extensibility:

  • Registration Improvements:

    • The IRegistrationFormEvents interface now includes Task RegisteringAsync(UserRegisteringContext context) for streamlined customization.
    • A new base class, RegistrationFormEventsBase, allows developers to override only necessary methods.
  • Login Improvements:

    • The ILoginFormEvent interface has a new method: Task<IActionResult> ValidatingLoginAsync(IUser user).
    • The LoginFormEventBase class enables overriding relevant methods. Note that the base implementation of LoggingInAsync() has been removed; you must now implement this method if using LoginFormEventBase.
  • User Service Update:

    • A new method in IUserService interface: Task<IUser> RegisterAsync(RegisterUserForm model, Action<string, string> reportError) facilitates registration with error reporting.

These enhancements make the user management system more modular and customizable.

Copy link
Contributor

This pull request has merge conflicts. Please resolve those before requesting a review.

Copy link
Contributor

This pull request has merge conflicts. Please resolve those before requesting a review.

@MikeAlhayek MikeAlhayek marked this pull request as ready for review November 23, 2024 20:48
@MikeAlhayek MikeAlhayek added this to the 3.0 milestone Nov 23, 2024
@MikeAlhayek MikeAlhayek requested a review from Piedone November 23, 2024 20:51
@MikeAlhayek MikeAlhayek requested a review from Piedone November 24, 2024 21:14
@Piedone
Copy link
Member

Piedone commented Nov 25, 2024

Please don't resolve the convos, because it gets really hard for me to follow them for a second review.

@MikeAlhayek MikeAlhayek requested a review from Piedone November 25, 2024 15:05
@MikeAlhayek MikeAlhayek merged commit 692c4ba into main Nov 25, 2024
18 checks passed
@MikeAlhayek MikeAlhayek deleted the ma/prevent-external-registration branch November 25, 2024 18:14
@MikeAlhayek MikeAlhayek added the breaking change 💥 Issues or pull requests that introduces breaking change(s) label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change 💥 Issues or pull requests that introduces breaking change(s)
Projects
None yet
2 participants