Hi,
Good to see that the problem has been fixed.
The Abp framework should handle a standard link like the one mentioned above (connect/endsession).
I will check it.
It redirects regardless of what we send to the redirect URL; it does not perform any checks (It might be a bug)
The problem has been fixed in the next version.
This is just an idea and simple code.
There are still many imperfections in it, You should improve it based on it
You can also consider upgrading to 7.3,
Hi,
You can override the AccountAppService and EmailConfirmation
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(AccountAppService))]
public class MyAccountAppService : AccountAppService
{
....
public override async Task ConfirmEmailAsync(ConfirmEmailInput input)
{
var user = await UserManager.GetByIdAsync(input.UserId);
if (user.EmailConfirmed)
{
return;
}
(await UserManager.ConfirmEmailAsync(user, input.Token)).CheckErrors();
(await UserManager.UpdateSecurityStampAsync(user)).CheckErrors();
await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext
{
Identity = IdentitySecurityLogIdentityConsts.Identity,
Action = IdentitySecurityLogActionConsts.ChangeEmail
});
}
}
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(EmailConfirmationModel))]
public class MyEmailConfirmationModel : EmailConfirmationModel
{
...
public override async Task<IActionResult> OnGetAsync()
{
ReturnUrl = GetRedirectUrl(ReturnUrl, ReturnUrlHash);
try
{
var user = await UserManager.GetByIdAsync(UserId);
if (user.EmailConfirmed)
{
EmailConfirmed = true;
return Page();
}
ValidateModel();
InvalidToken = !await AccountAppService.VerifyEmailConfirmationTokenAsync(
new VerifyEmailConfirmationTokenInput()
{
UserId = UserId,
Token = ConfirmationToken
}
);
if (!InvalidToken)
{
await _accountAppService.ConfirmEmailAsync(new ConfirmEmailInput
{
UserId = UserId,
Token = ConfirmationToken
});
EmailConfirmed = true;
}
}
catch (Exception e)
{
if (e is AbpIdentityResultException && !string.IsNullOrWhiteSpace(e.Message))
{
Alerts.Warning(GetLocalizeExceptionMessage(e));
return Page();
}
if (e is AbpValidationException)
{
return Page();
}
throw;
}
return Page();
}
}
Hi,
You need to customize the Text Templates module. see: https://docs.abp.io/en/abp/latest/UI/AspNetCore/Customization-User-Interface
If you need the InlineContent page code of the Text Templates module, I can share it with you via email.
Hi,
We have a document, you can check it:
https://docs.abp.io/en/commercial/7.4/themes/lepton-x/mvc
Hi,
This is a certificate problem, could you share the AuthModule.cs code?
Hi,
Ok, I understand.
post_logout_redirect_uri is a standard IdentityServer endpoint /connect/endsession's parameter
But /Account/LoggedOut is an ABP razor page, that's why post_logout_redirect_uri will not work.
You can rename the parameter via middleware, for example:
public class AccountLogoutQueryStringMiddleware
{
private readonly RequestDelegate _next;
public AccountLogoutQueryStringMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task InvokeAsync(HttpContext context)
{
if (context.Request.Path.ToString().Contains("Account/LoggedOut"))
{
if (context.Request.Query.ContainsKey("post_logout_redirect_uri"))
{
context.Request.QueryString = context.Request.QueryString.Add("PostLogoutRedirectUri", context.Request.Query["post_logout_redirect_uri"].ToString());
}
}
await _next(context);
}
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var env = context.GetEnvironment();
var app = context.GetApplicationBuilder();
app.UseMiddleware<AccountLogoutQueryStringMiddleware>();
.......
}
Hi,
It's possible, But need to customize the theme.
I will investigate and give you some sample code.