Merge pull request #3813 from pyramidsbuilder/3805-stop-registration-redirect-without-verification

display verification message instead of redirecting new user before e…
This commit is contained in:
Shaun Walker 2024-02-22 12:34:21 -05:00 committed by GitHub
commit b2dc397fb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,8 @@
@inject ISettingService SettingService
@if (PageState.Site.AllowRegistration)
{
if (!_userCreated)
{
<AuthorizeView Roles="@RoleNames.Registered">
<Authorizing>
@ -69,6 +71,7 @@
</NotAuthorized>
</AuthorizeView>
}
}
else
{
<ModuleMessage Message="@Localizer["Info.Registration.Disabled"]" Type="MessageType.Info" />
@ -85,6 +88,7 @@ else
private string _confirm = string.Empty;
private string _email = string.Empty;
private string _displayname = string.Empty;
private bool _userCreated = false;
private bool _allowsitelogin = true;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Anonymous;
@ -128,15 +132,9 @@ else
if (user != null)
{
await logger.LogInformation("User Created {Username} {Email}", _username, _email);
if (!string.IsNullOrEmpty(PageState.ReturnUrl))
{
NavigationManager.NavigateTo(PageState.ReturnUrl);
}
else // legacy behavior
{
_userCreated = true;
AddModuleMessage(Localizer["Info.User.AccountCreate"], MessageType.Info);
}
}
else
{
await logger.LogError("Error Adding User {Username} {Email}", _username, _email);