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:
commit
b2dc397fb0
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
@if (PageState.Site.AllowRegistration)
|
@if (PageState.Site.AllowRegistration)
|
||||||
{
|
{
|
||||||
|
if (!_userCreated)
|
||||||
|
{
|
||||||
<AuthorizeView Roles="@RoleNames.Registered">
|
<AuthorizeView Roles="@RoleNames.Registered">
|
||||||
<Authorizing>
|
<Authorizing>
|
||||||
<text>...</text>
|
<text>...</text>
|
||||||
|
@ -68,6 +70,7 @@
|
||||||
</form>
|
</form>
|
||||||
</NotAuthorized>
|
</NotAuthorized>
|
||||||
</AuthorizeView>
|
</AuthorizeView>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -85,6 +88,7 @@ else
|
||||||
private string _confirm = string.Empty;
|
private string _confirm = string.Empty;
|
||||||
private string _email = string.Empty;
|
private string _email = string.Empty;
|
||||||
private string _displayname = string.Empty;
|
private string _displayname = string.Empty;
|
||||||
|
private bool _userCreated = false;
|
||||||
private bool _allowsitelogin = true;
|
private bool _allowsitelogin = true;
|
||||||
|
|
||||||
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Anonymous;
|
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Anonymous;
|
||||||
|
@ -128,15 +132,9 @@ else
|
||||||
if (user != null)
|
if (user != null)
|
||||||
{
|
{
|
||||||
await logger.LogInformation("User Created {Username} {Email}", _username, _email);
|
await logger.LogInformation("User Created {Username} {Email}", _username, _email);
|
||||||
if (!string.IsNullOrEmpty(PageState.ReturnUrl))
|
_userCreated = true;
|
||||||
{
|
|
||||||
NavigationManager.NavigateTo(PageState.ReturnUrl);
|
|
||||||
}
|
|
||||||
else // legacy behavior
|
|
||||||
{
|
|
||||||
AddModuleMessage(Localizer["Info.User.AccountCreate"], MessageType.Info);
|
AddModuleMessage(Localizer["Info.User.AccountCreate"], MessageType.Info);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await logger.LogError("Error Adding User {Username} {Email}", _username, _email);
|
await logger.LogError("Error Adding User {Username} {Email}", _username, _email);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user