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

Add condition for User moderation and Email confirmation upon registration #17611

Merged

Conversation

SzymonSel
Copy link
Member

No description provided.

@Piedone Piedone merged commit 21273ca into OrchardCMS:main Mar 14, 2025
12 checks passed
@sebastienros
Copy link
Member

But why?

Also it seems weird to check an option like _registrationOptions.UsersMustValidateEmail without checking if the email is validated.

@SzymonSel
Copy link
Member Author

This condition is only here to prevent logging users in upon registration. As I understand auto-sign-in should not happen if UsersAreModerated (aka "users must be approved before logging in").

It's the same story for UsersMustValidateEmail

@gvkries
Copy link
Contributor

gvkries commented Mar 19, 2025

Actually, I think this patch is not correct. Moderation and email confirmation must be checked, but it's done by the event handlers (RegisteringAsync event). A bug is in the EmailConfirmationRegistrationFormEvents, where CancelSignIn should be set to false.

IMHO it is a different question if this design makes sense at all. This is security critical and by requiring the event handlers to cancel sign-in is is easily to get wrong.

@SzymonSel
Copy link
Member Author

Good point there @gvkries . @Piedone @sebastienros ?

@gvkries
Copy link
Contributor

gvkries commented Mar 19, 2025

CancelSignIn should be set to false.

I meant "set to true" 😇

@Piedone
Copy link
Member

Piedone commented Mar 19, 2025

Yes, can you please fix these @SzymonSel?

@SzymonSel
Copy link
Member Author

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants