Activities of "ebizeul"

Hi liangshiwei,

Yes, here is my CustomLoginModel.cs code :

using Microsoft.AspNetCore.Authentication;
using Microsoft.Extensions.Options;
using Volo.Abp.Account.Public.Web;
using Volo.Abp.Account.Public.Web.Pages.Account;

namespace MyProject.Configurateur.Web.Pages.Account
{
    public class CustomLoginModel : LoginModel
    {
        public CustomLoginModel(IAuthenticationSchemeProvider schemeProvider, IOptions<AbpAccountOptions> accountOptions)
        : base(schemeProvider, accountOptions)
        {
        }
    }
}

And here my Login.cshtml code :

@page
@model MyProject.Configurateur.Web.Pages.Account.CustomLoginModel
@inherits MyProject.Configurateur.Web.Pages.ConfigurateurPage
@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout
@{
    PageLayout.Content.Title = L["Login"].Value;
    Layout = "_SharedLayout";
}

<div class="account-module-form">

    <h1>
        @L["MyAccount"]
    </h1>

    @if (Model.EnableLocalLogin)
    {
        <form method="post">
            <input asp-for="ReturnUrl" />
            <input asp-for="ReturnUrlHash" />
            <abp-input asp-for="LoginInput.UserNameOrEmailAddress" label=@L["EmailAddress"].Value required-symbol="false" />
            <abp-input asp-for="LoginInput.Password" label=@L["Password"].Value required-symbol="false" />
            <abp-row>
                <abp-column>
                    <abp-input asp-for="LoginInput.RememberMe" label=@L["RememberMe"].Value class="mb-4" />
                </abp-column>
                <abp-column class="text-right">
                    <a href="@Url.Page("./ForgotPassword")">@L["ForgotPassword"]</a>
                </abp-column>
            </abp-row>
            <abp-button button-type="Primary" size="Block" type="submit" class="mt-2 mb-3" name="Action" value="Login">@L["Login"]</abp-button>
        </form>
    }

    @if (Model.VisibleExternalProviders.Any())
    {
        <hr />
        @L["OrSignInWith"]<br />
        <form asp-page="./Login" asp-page-handler="ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" asp-route-returnUrlHash="@Model.ReturnUrlHash" method="post">
            <input asp-for="ReturnUrl" />
            <input asp-for="ReturnUrlHash" />
            @foreach (var provider in Model.VisibleExternalProviders)
            {
                <abp-button type="submit" button-type="Outline_Primary" size="Small" class="mt-2 mr-2" name="provider" value="@provider.AuthenticationScheme">@provider.DisplayName</abp-button>
            }
        </form>
    }

    @if (!Model.EnableLocalLogin && !Model.VisibleExternalProviders.Any())
    {
        <div class="alert alert-warning">
            <strong>Invalid login request</strong>
            There are no login schemes configured for this client.
        </div>
    }
</div>

Showing 1 to 1 of 1 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09