-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pull request has merge conflicts. Please resolve those before requesting a review. |
This pull request has merge conflicts. Please resolve those before requesting a review. |
Piedone
requested changes
Nov 24, 2024
src/OrchardCore/OrchardCore.Users.Abstractions/Events/ILoginFormEvent.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/Handlers/EmailConfirmationRegistrationFormEvents.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/Handlers/EmailConfirmationUserEvent.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/Handlers/RegistrationUserEvent.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/Handlers/UserRegistrationFormEvents.cs
Outdated
Show resolved
Hide resolved
Please don't resolve the convos, because it gets really hard for me to follow them for a second review. |
Piedone
requested changes
Nov 25, 2024
src/OrchardCore.Modules/OrchardCore.Users/Controllers/AccountController.cs
Outdated
Show resolved
Hide resolved
…/OrchardCMS/OrchardCore into ma/prevent-external-registration
Piedone
requested changes
Nov 25, 2024
src/OrchardCore.Modules/OrchardCore.Users/Services/ExternalLoginFormEvents.cs
Outdated
Show resolved
Hide resolved
MikeAlhayek
added a commit
that referenced
this pull request
Nov 25, 2024
Piedone
approved these changes
Nov 25, 2024
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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:
Release Notes
The user registration and login functionalities have been refactored for better extensibility:
Registration Improvements:
IRegistrationFormEvents
interface now includesTask RegisteringAsync(UserRegisteringContext context)
for streamlined customization.RegistrationFormEventsBase
, allows developers to override only necessary methods.Login Improvements:
ILoginFormEvent
interface has a new method:Task<IActionResult> ValidatingLoginAsync(IUser user)
.LoginFormEventBase
class enables overriding relevant methods. Note that the base implementation ofLoggingInAsync()
has been removed; you must now implement this method if usingLoginFormEventBase
.User Service Update:
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.