The Cancel button is only displayed in Identity Server.

Resolve #4731
pull/4736/head
maliming 5 years ago
parent baed9702ae
commit 48ad264e3d

@ -50,6 +50,8 @@ namespace Volo.Abp.Account.Web.Pages.Account
if (context != null)
{
ShowCancelButton = true;
LoginInput.UserNameOrEmailAddress = context.LoginHint;
//TODO: Reference AspNetCore MultiTenancy module and use options to get the tenant key!

@ -41,9 +41,12 @@
</form>
</div>
<div class="card-footer text-center border-0">
<abp-button type="button" button-type="Link" name="Action" value="Cancel" class="px-2 py-0">@L["Cancel"]</abp-button> @* TODO: Only show if identity server is used *@
</div>
@if (Model.ShowCancelButton)
{
<div class="card-footer text-center border-0">
<abp-button type="button" button-type="Link" name="Action" value="Cancel" class="px-2 py-0">@L["Cancel"]</abp-button>
</div>
}
</div>
}

@ -51,6 +51,11 @@ namespace Volo.Abp.Account.Web.Pages.Account
protected IAuthenticationSchemeProvider SchemeProvider { get; }
protected AbpAccountOptions AccountOptions { get; }
/// <summary>
/// TODO: Find a better way to implement it. Only show if identity server is used.
/// </summary>
public bool ShowCancelButton { get; set; }
public LoginModel(
IAuthenticationSchemeProvider schemeProvider,
IOptions<AbpAccountOptions> accountOptions)
@ -83,7 +88,7 @@ namespace Volo.Abp.Account.Web.Pages.Account
ValidateModel();
ExternalProviders = await GetExternalProviders();
EnableLocalLogin = await SettingProvider.IsTrueAsync(AccountSettingNames.EnableLocalLogin);
await ReplaceEmailToUsernameOfInputIfNeeds();

Loading…
Cancel
Save