Activities of "LiSong"

Here are what we wanted

  1. removing the current tenant switch;
  2. adding a new textbox called Invite Code
  3. creating a function to map the invite codes to tenant id (for example, XDEF(Code) -> test(Tenant Id); i.e. when type XDEF for code, users will create a new account for test tenant

The reason we do this is that we don't want to expose the platform's tenants externally.

same error using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Diagnostics; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http.Extensions; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Owl.reCAPTCHA; using Volo.Abp; using Volo.Abp.Account; using Volo.Abp.Account.ExternalProviders; using Volo.Abp.Account.Public.Web; using Volo.Abp.Account.Public.Web.Pages.Account; using Volo.Abp.Account.Public.Web.Security.Recaptcha; using Volo.Abp.Account.Security.Recaptcha; using Volo.Abp.Account.Settings; using Volo.Abp.Auditing; using Volo.Abp.DependencyInjection; using Volo.Abp.Identity; using Volo.Abp.Identity.AspNetCore; using Volo.Abp.Identity.Settings; using Volo.Abp.Reflection; using Volo.Abp.Security.Claims; using Volo.Abp.Settings; using Volo.Abp.Uow; using Volo.Abp.Users; using Volo.Abp.Validation; using IdentityUser = Volo.Abp.Identity.IdentityUser;

namespace Tapp.Web.Pages.Account;

[Dependency(ReplaceServices = true)] [ExposeServices(typeof(LoginModel))] [DisableAuditing] public class TappLoginModel : LoginModel, ITransientDependency {

public TappLoginModel(
    IAuthenticationSchemeProvider schemeProvider,
    IOptions<AbpAccountOptions> accountOptions,
    IAbpRecaptchaValidatorFactory recaptchaValidatorFactory,
    IAccountExternalProviderAppService accountExternalProviderAppService,
    ICurrentPrincipalAccessor currentPrincipalAccessor,
    IOptions<IdentityOptions> identityOptions,
    IOptionsSnapshot<reCAPTCHAOptions> reCaptchaOptions) : base(
    schemeProvider,
    accountOptions,
    recaptchaValidatorFactory,
    accountExternalProviderAppService,
    currentPrincipalAccessor,
    identityOptions,
    reCaptchaOptions)
{

}

}

@page @using Microsoft.AspNetCore.Mvc.Localization @using Microsoft.Extensions.Options @using Owl.reCAPTCHA @using Volo.Abp.Account.Localization @using Volo.Abp.Account.Public.Web.Pages.Account; @using Volo.Abp.Account.Public.Web.Security.Recaptcha @using Volo.Abp.Account.Settings @using Volo.Abp.Identity; @using Volo.Abp.Settings @model Tapp.Web.Pages.Account.TappLoginModel

@inject IHtmlLocalizer<AccountResource> L @inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout @inject ISettingProvider SettingProvider @{ PageLayout.Content.Title = L["Login"].Value; var reCaptchaVersion = await SettingProvider.GetAsync<int>(AccountSettingNames.Captcha.Version); if (Model.UseCaptcha) { await Model.ReCaptchaOptions.SetAsync(reCaptchaVersion == 3 ? reCAPTCHAConsts.V3 : reCAPTCHAConsts.V2); }

}

@section scripts { <abp-script-bundle name="@typeof(LoginModel).FullName"> <abp-script src="/Pages/Account/Login.js" /> </abp-script-bundle>

@if (Model.UseCaptcha)
{
    if (reCaptchaVersion == 3)
    {
        &lt;recaptcha-script-v3 /&gt;
        &lt;recaptcha-script-v3-js action=&quot;login&quot; execute=&quot;false&quot; /&gt;
    }
    else
    {
        &lt;recaptcha-script-v2 /&gt;
    }
}

}

@if (Model.IsLinkLogin) { <abp-alert alert-type="Warning"> @L["LinkAccountWarning", Url.PageLink()] </abp-alert> }

@if (Model.BackToExternalLogins) { <div class="d-grid gap-2"> <a class="mb-3 btn btn-primary btn-block" href="@Url.Page("./ExternalLogins")">@L["Back"]</a> </div> } <div class="account-module-form">

@if (Model.IsSelfRegistrationEnabled)
{
    &lt;h5 class=&quot;mb-2&quot;&gt;@L["NotAMemberYet"] &lt;a class=&quot;text-decoration-none&quot; href=&quot;@Url.Page(&quot;./Register&quot;, new {returnUrl = Model.ReturnUrl, returnUrlHash = Model.ReturnUrlHash})&quot;&gt;@L["Register"]&lt;/a&gt;&lt;/h5&gt;
}

@if (Model.EnableLocalLogin)
{
    &lt;form method=&quot;post&quot; id=&quot;loginForm&quot;&gt;
        @if (Model.UseCaptcha)
        {
            &lt;input class=&quot;mb-3&quot; data-captcha=&quot;true&quot; type=&quot;hidden&quot; name=&quot;@RecaptchaValidatorBase.RecaptchaResponseKey&quot; id=&quot;@RecaptchaValidatorBase.RecaptchaResponseKey&quot;/&gt;
        }
        &lt;div&gt;
            &lt;div class=&quot;form-floating mb-2&quot;&gt;
                &lt;input asp-for=&quot;LoginInput.UserNameOrEmailAddress&quot; type=&quot;text&quot; class=&quot;form-control&quot; placeholder=&quot;name@example.com&quot;&gt;
                @Html.LabelFor(m => m.LoginInput.UserNameOrEmailAddress, "Email Address")
                &lt;span asp-validation-for=&quot;LoginInput.UserNameOrEmailAddress&quot;/&gt;
            &lt;/div&gt;

            &lt;div class=&quot;form-floating mb-2&quot;&gt;
                &lt;input asp-for=&quot;LoginInput.Password&quot; id=&quot;password-input&quot; type=&quot;password&quot; class=&quot;form-control&quot; placeholder=&quot;Password&quot;&gt;
                @Html.LabelFor(m => m.LoginInput.Password)
                &lt;i id=&quot;PasswordVisibilityButton&quot; class=&quot;bi bi-eye-slash show-pass-icon&quot; data-bs-toggle=&quot;tooltip&quot; data-bs-placement=&quot;top&quot; data-bs-html=&quot;true&quot; aria-label=&quot;@L[&quot;ShowPassword&quot;]&quot; data-bs-original-title=&quot;@L[&quot;ShowPassword&quot;]&quot;&gt;&lt;/i&gt;
                &lt;i id=&quot;capslockicon&quot; class=&quot;bi bi-capslock caps-lock-icon&quot; style=&quot;display: none;&quot; data-bs-toggle=&quot;tooltip&quot; data-bs-placement=&quot;top&quot; data-bs-html=&quot;true&quot; aria-label=&quot;&lt;i class=&#39;bi bi-exclamation-circle&#39;&gt;&lt;/i&gt; @L["CapsLockOn"]!" data-bs-original-title="&lt;i class=&#39;bi bi-exclamation-circle&#39;&gt;&lt;/i&gt; @L["CapsLockOn"]!">&lt;/i&gt;
                &lt;span asp-validation-for=&quot;LoginInput.Password&quot;/&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;abp-row&gt;
            &lt;abp-column&gt;
                &lt;div class=&quot;form-switch ps-2&quot;&gt;
                    &lt;abp-input asp-for=&quot;LoginInput.RememberMe&quot; class=&quot;mb-4&quot;/&gt;
                &lt;/div&gt;
            &lt;/abp-column&gt;
            &lt;abp-column class=&quot;text-end&quot;&gt;
                &lt;a href=&quot;@Url.Page(&quot;./ForgotPassword&quot;, new {returnUrl = Model.ReturnUrl, returnUrlHash = Model.ReturnUrlHash})&quot;&gt;@L["ForgotPassword"]&lt;/a&gt;
            &lt;/abp-column&gt;
        &lt;/abp-row&gt;

        @if (reCaptchaVersion == 2)
        {
            &lt;script&gt;
                recaptchaCallback = function (token) {
                    $('form button[type=submit]').removeAttr("disabled");
                    $('#@RecaptchaValidatorBase.RecaptchaResponseKey').val(token)
                };
            &lt;/script&gt;
            &lt;div class=&quot;mb-3&quot;&gt;
                &lt;recaptcha-div-v2 callback=&quot;recaptchaCallback&quot;/&gt;
            &lt;/div&gt;
        }

        &lt;div class=&quot;d-grid gap-2&quot;&gt;
            &lt;abp-button button-type=&quot;Primary&quot; type=&quot;submit&quot; class=&quot;mb-3&quot; name=&quot;Action&quot; value=&quot;Login&quot; disabled=&quot;true&quot;&gt;
                &lt;i class=&quot;bi bi-box-arrow-in-right me-1&quot;&gt;&lt;/i&gt;
                @L["Login"]
            &lt;/abp-button&gt;
        &lt;/div&gt;

        @if (Model.ShowCancelButton)
        {
            &lt;div class=&quot;d-grid gap-2&quot;&gt;
                &lt;abp-button button-type=&quot;Secondary&quot; type=&quot;submit&quot; formnovalidate=&quot;formnovalidate&quot; class=&quot;mb-3&quot; name=&quot;Action&quot; value=&quot;Cancel&quot;&gt;@L["Cancel"]&lt;/abp-button&gt;
            &lt;/div&gt;
        }
    &lt;/form&gt;
}

@if (Model.VisibleExternalProviders.Any() && false)
{
    if(Model.EnableLocalLogin)
    {
        &lt;hr/&gt;
        @L["OrSignInWith"]
        &lt;br/&gt;
    }
    else
    {
        @L["SignInWithOneOfTheFollowingProviders"]
    }

    &lt;form asp-page=&quot;./Login&quot; asp-page-handler=&quot;ExternalLogin&quot;
          asp-route-returnUrl=&quot;@Model.ReturnUrl&quot;
          asp-route-returnUrlHash=&quot;@Model.ReturnUrlHash&quot;
          asp-route-linkTenantId=&quot;@Model.LinkTenantId&quot;
          asp-route-linkUserId=&quot;@Model.LinkUserId&quot;
          asp-route-linkToken=&quot;@Model.LinkToken&quot;
          method=&quot;post&quot;&gt;
        @foreach (var provider in Model.VisibleExternalProviders)
        {
            &lt;button type=&quot;submit&quot;
                    class=&quot;mt-2 me-2 btn btn-outline-primary btn-sm&quot;
                    name=&quot;provider&quot;
                    value=&quot;@provider.AuthenticationScheme&quot;
                    data-busy-text=&quot;@L[&quot;ProcessingWithThreeDot&quot;]&quot;&gt;
                @if (provider.Icon != null)
                {
                    &lt;i class=&quot;@provider.Icon&quot;&gt;&lt;/i&gt;
                }
                &lt;span&gt;@provider.DisplayName&lt;/span&gt;
            &lt;/button&gt;
        }
    &lt;/form&gt;
}

</div>

my project was not configured to use multi-tenacy when I created it. I enabled it through code I created a new project with "enable multi tenancy" checkbox and then, I checked the database schema, seems like they are different

I got this error page:

An unhandled exception occurred while processing the request. ComponentNotRegisteredException: The requested service 'Tapp.Web.Pages.Account.TappLoginModel' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.

See https://autofac.rtfd.io/help/service-not-registered for more info. Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable<Parameter> parameters)

Stack Query Cookies Headers Routing ComponentNotRegisteredException: The requested service 'Tapp.Web.Pages.Account.TappLoginModel' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency. See https://autofac.rtfd.io/help/service-not-registered for more info. Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable<Parameter> parameters) Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable<Parameter> parameters) Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetRequiredService(Type serviceType) Volo.Abp.AspNetCore.Mvc.UI.RazorPages.ServiceBasedPageModelActivatorProvider+<>c__DisplayClass0_0.<CreateActivator>b__0(PageContext context) Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.DefaultPageModelFactoryProvider+<>c__DisplayClass3_0.<CreateModelFactory>b__0(PageContext pageContext) Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.CreateInstance() Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextResourceFilter() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger) Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Volo.Abp.AspNetCore.Security.Claims.AbpDynamicClaimsMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Volo.Abp.AspNetCore.Uow.AbpUnitOfWorkMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Builder.ApplicationBuilderAbpOpenIddictMiddlewareExtension+<>c__DisplayClass0_0+<<UseAbpOpenIddictValidation>b__0>d.MoveNext() Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Volo.Abp.Studio.Client.AspNetCore.AbpStudioMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Volo.Abp.Studio.Client.AspNetCore.AbpStudioMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Volo.Abp.Studio.Client.AspNetCore.AbpStudioMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Show raw exception details

Answer

for the #2, after we enable it, the recaptcha was not stable, I checked the code and found that the recaptcha google js code is on the bottom, this could cause issues if users take action immediately before the js code is loaded, can you tell me how we can move the js code to the head tag?

            &lt;script src=&quot;https://www.google.com/recaptcha/api.js?hl=en&amp;render=99999&quot;&gt;&lt;/script&gt;
            &lt;script&gt;grecaptcha.ready(function(){ grecaptcha.reExecute = function(callback){grecaptcha.execute
Answer

#2, we didn't enable it, that was the issue, our settings is just like your screenshot; #3, no, we tried many times, normally the cookie won't become invalid and we don't need to re-login, this issue happened randomly

yes, the same

no, I didn't override the page

yes! worked

I upgraded to 9.0.3, it's still the same, the issue here is that the system automatically sends the first email, then this page loads and with this verifiy button. The user clicks the button, and at that point, a second email will be sent. Is there a way to detect that the system has sent the first email and prevent the button from being displayed?

Showing 51 to 60 of 80 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 10, 2025, 12:02
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.