Hi, We are using Abp Commercial 5.1.3 / EF / Blazor Server / Non-Tiered.
With a newly created project from Abp Suite, we get the following when keying in blank spaces into an input on either login or registration.
We overrode the register razor page, to enhance the validation and get a better understanding how it works in Abp. The input model in Abp has the Required attribute defined for each input field, but blank spaces are not picked up by the UI and the RegisterLocalUserAsync method just exceptions out with an invalid model. So it is unclear to us what the recommended approach here is.
We followed: https://docs.abp.io/en/abp/4.4/Validation#validation ... and implemented the following in Register.cshtml.cs
public IEnumerable<ValidationResult> Validate(
ValidationContext validationContext)
{
if (FirstName.Trim() == String.Empty)
{
yield return new ValidationResult(
"First Name must be specified",
new[] { "FirstName" }
);
}
}
This kind of worked once we caught the validation exception, but this validation is all server side and not client side like when the inputs are null and the 'Required' attribute is set in the data model. Additionally the UI is lacking and not consistent when we do this validation.
For example, the built in required validation looks correct, like this:
but the server side validation to accommodate blank spaces is styled like this...
Any help or recommendations you have is greatly appreciated.
Regards, @balessi75
hi
For 6-digit codes it is valid for 3 minutes, others default to 1 day, of course you can configure it. This belongs to ASP NET Core Identity.
https://github.com/dotnet/aspnetcore/blob/main/src/Identity/Extensions.Core/src/Rfc6238AuthenticationService.cs#L16
https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.identity.dataprotectiontokenprovideroptions.tokenlifespan?view=aspnetcore-6.0#microsoft-aspnetcore-identity-dataprotectiontokenprovideroptions-tokenlifespan
Excellent! Thank you @maliming!
Hi @balessi75
You can create
abp.resourcemapping.js
manually in your project. You can find the default template of it below: https://github.com/abpframework/abp/blob/b920220c672d8d1fbbbae850965bb117d8a71da1/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/abp.resourcemapping.jsmodule.exports = { aliases: { }, clean: [ ], mappings: { } };
After updating
package.json
andabp.resourcemapping.js
files, abp install-lib command will work properly and copy your dependencies under wwwroot.abp install-libs
Hi @enisn,
We manually created a abp.resourcemapping.js file in the root of our Blazor project, but we are getting compile time errors:
Any ideas? Does the js file need to be in a certain location for a Blazor Server project?
Abp Commercial 5.1.3 / EF / Non-Tiered / Blazor Server
Is there an expiration on the confirm email link, password reset link, or 2 factor code in Abp? If so what is it's default expiration time and how can it be changed and or implemented (if not provided by Abp)?
Could you spot where exactly
input.DateOfBirth
lose its value?
input.DateOfBirth never looses it's value, but the input UI is cleared.
So I am guessing you are non-tiered Blazor server application.
Doesn't matter, you can use Blazor.Server project instead of Web. Blazor-Server has similar structure with MVC/Razor web application. MVC cshtml pages can run along with razor pages. Same configurations for bundling applies. You will be overriding Account/Register page which is already an MVC page.
Yes, this is a non-tiered Blazor server application.
We are following the community article: https://community.abp.io/posts/how-to-integrate-the-telerik-ui-for-asp.net-core-kendo-components-with-the-abp-mvc-ui-u2voab2a
We are stuck at the step: In the abp.resourcemapping.js file, add the necessary entries that look like the following:
module.exports = {
aliases: {
},
mappings: {
"@node_modules/@progress/kendo-ui/css/**/*": "@libs/kendo/css",
"@node_modules/@progress/kendo-ui/js/**/*": "@libs/kendo/js"
}
};
... because our Blazor Server solution created from Abp Suite has no abp.resourcemapping.js file. If we attempt to create one in our Blazor project, we get compile time errors...
Error CS0103 The name 'module' does not exist in the current context
Any help is much appreciated.
hi
Is your
SESEmailSender
implement theIEmailSender
and replace default one in the DI?Account Pro will use
IEmailSender
to send emails by default.https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/IEmailSender.cs#L9
When creating a custom email sender (SESEmailSender in this case) that implements IEmailSender, how does one have Account Pro register the custom email sender to the DI?
Does this issue occur when you use a simple
<input type='date' .../>
instead of<abp-input... />
?
Interesting...
Yes it does also occur with a simple <input type='date' .../> and it also occurs with @Html.EditorFor(model => model.Input.DateOfBirth)
Any thoughts?
Can using Telerik UI for MVC/Razor be an option? If so Cusomize Login Page article may help.
Not sure this is possible with a Blazor Server Abp solution. In looking at this community article...
https://community.abp.io/posts/how-to-integrate-the-telerik-ui-for-asp.net-core-kendo-components-with-the-abp-mvc-ui-u2voab2a
...there seems to be a lot of configuration needed for a MVC solution. For example, creating .js and bundling configurations in the .Web project, but our Blazor Server templated Abp solution has no .Web project.
Thoughts?
Can using Telerik UI for MVC/Razor be an option? If so Cusomize Login Page article may help.
Thanks @gterdem. I will give that a try and post whether or not this solution works...