I tried as you describe like above in every web, api and service solution with UTC confgiuration
Now, it's not working in my local too.
When user select the datetime from calender, it's writing it as same as to db.
But Abp generated fields written in UTC, user selected date time fields written as same as to db.
For example:
User click the today button and created the record. Creation Time saved as UTC , but Test Date Time saved as UTC+3
Hi,
Actually, user choose the date and time in a razor page view like below
<abp-date-picker time-picker="true" auto-update-input="false" today-button-classes="btn-primary" asp-for="Detail.TestDateTime" data-date="" />
And after selection, when user click the save button below method is executing.
public virtual async Task<IActionResult> OnPostAsync()
{
await _detailsAppService.CreateAsync(ObjectMapper.Map<DetailCreateViewModel, DetailCreateDto>(Detail));
return NoContent();
}
When i try to convert TestDateTime onPost method like below, it does not convert the selected time to utc. Clock.ConvertToUtc(Detail.TestDateTime.Value)
Hi ma,
It' works now.
Thank you so much for your suggestion, i forget to use
$form.handleDatepicker('input[type="hidden"][data-hidden-datepicker]'); before posts.
In the meantime, could it be more effective to develop a more global solution and prevent developers from performing the above operation on every page, and to produce a solution that will perform this operation if multi time zone is active throughout the application?
Likewise, the same issue can be automated in data table columns where datatables are located, and if we can add a parameter to the normalizeToLocaleString() method as we passed with options when we automate it, I think it would be great.
Thank you again for your support.
But everytime when we update an entity we need to make change at least 30 place. Can you help please?
We checked the codes, there is not any code block that sets TokenLifespan except options.TokenLifespan = TimeSpan.FromMinutes(2);
I'm checking it in my local computer.
How can I check "distributed cache for identity, ensure cache invalidation is working as expected"?
public virtual async Task<BasicUserInfoDto> TrevaSendPasswordResetCodeAsync(TrevaSendPasswordResetCodeDto input)
{
var user = await UserManager.FindByEmailAsync(input.Email) ??
throw new UserFriendlyException(L["Volo.Account:InvalidEmailAddress", input.Email]);
var resetToken = await UserManager.GeneratePasswordResetTokenAsync(user);
await _trevaAccountEmailer.TrevaSendPasswordResetCodeAsync(user, resetToken);
return new BasicUserInfoDto
{
UserId = user.Id,
TenantId = user.TenantId
};
}
public override async Task<bool> VerifyPasswordResetTokenAsync(VerifyPasswordResetTokenInput input)
{
var user = await UserManager.GetByIdAsync(input.UserId);
return await UserManager.VerifyUserTokenAsync(
user,
UserManager.Options.Tokens.PasswordResetTokenProvider,
UserManager<Volo.Abp.Identity.IdentityUser>.ResetPasswordTokenPurpose,
input.ResetToken);
}
/// <summary>
/// Generates a password reset token for the specified <paramref name="user"/>, using
/// the configured password reset token provider.
/// </summary>
/// <param name="user">The user to generate a password reset token for.</param>
/// <returns>The <see cref="Task"/> that represents the asynchronous operation,
/// containing a password reset token for the specified <paramref name="user"/>.</returns>
public virtual Task<string> GeneratePasswordResetTokenAsync(TUser user)
{
ThrowIfDisposed();
return GenerateUserTokenAsync(user, Options.Tokens.PasswordResetTokenProvider, ResetPasswordTokenPurpose);
}
/// <summary>
/// Returns a flag indicating whether the specified <paramref name="token"/> is valid for
/// the given <paramref name="user"/> and <paramref name="purpose"/>.
/// </summary>
/// <param name="user">The user to validate the token against.</param>
/// <param name="tokenProvider">The token provider used to generate the token.</param>
/// <param name="purpose">The purpose the token should be generated for.</param>
/// <param name="token">The token to validate</param>
/// <returns>
/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the <paramref name="token"/>
/// is valid, otherwise false.
/// </returns>
public virtual async Task<bool> VerifyUserTokenAsync(TUser user, string tokenProvider, string purpose, string token)
{
ThrowIfDisposed();
ArgumentNullThrowHelper.ThrowIfNull(user);
ArgumentNullThrowHelper.ThrowIfNull(tokenProvider);
if (!_tokenProviders.TryGetValue(tokenProvider, out var provider))
{
throw new NotSupportedException(Resources.FormatNoTokenProvider(nameof(TUser), tokenProvider));
}
// Make sure the token is valid
var result = await provider.ValidateAsync(purpose, token, this, user).ConfigureAwait(false);
if (!result && Logger.IsEnabled(LogLevel.Debug))
{
Logger.LogDebug(LoggerEventIds.VerifyUserTokenFailed, "VerifyUserTokenAsync() failed with purpose: {purpose} for user.", purpose);
}
return result;
}
Hi ma,
Thank you for help, i implemented the token providers as needed.
Now, everything works as i expected.
Thank you again (l)
Hi, thank you.