Hi,
Could you share the full steps or a simple example project with me? I will check it. thanks. my email is shiwei.liang@volosoft.com
Hi,
Yes, you can override the registermodel.
For example:
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(RegisterModel))]
public class MyRegisterModel : RegisterModel
{
public MyRegisterModel(IAuthenticationSchemeProvider schemeProvider, IOptions<AbpAccountOptions> accountOptions, IAccountExternalProviderAppService accountExternalProviderAppService, ICurrentPrincipalAccessor currentPrincipalAccessor, IHttpClientFactory httpClientFactory) : base(schemeProvider, accountOptions, accountExternalProviderAppService, currentPrincipalAccessor, httpClientFactory)
{
}
public override async Task<IActionResult> OnGetAsync()
{
ExternalProviders = await GetExternalProviders();
if (IsExternalLogin)
{
return await AutoRegisterUser();
}
if (!await CheckSelfRegistrationAsync())
{
if (IsExternalLoginOnly)
{
return await OnPostExternalLogin(ExternalLoginScheme);
}
Alerts.Warning(L["SelfRegistrationDisabledMessage"]);
return Page();
}
await TrySetEmailAsync();
await SetUseCaptchaAsync();
return Page();
}
private async Task<IActionResult> AutoRegisterUser()
{
var externalLoginInfo = await SignInManager.GetExternalLoginInfoAsync();
if (externalLoginInfo == null)
{
Logger.LogWarning("External login info is not available");
return RedirectToPage("./Login");
}
var identity = externalLoginInfo.Principal.Identities.First();
var emailClaim = identity.FindFirst(AbpClaimTypes.Email) ?? identity.FindFirst(ClaimTypes.Email);
if (emailClaim == null)
{
Logger.LogWarning("Email claim is not available");
return RedirectToPage("./Login");
}
var email = emailClaim.Value;
var userName = await UserManager.GetUserNameFromEmailAsync(email);
var user = await RegisterExternalUserAsync(externalLoginInfo, email, userName);
await SignInManager.SignInAsync(user, isPersistent: true, authenticationMethod: ExternalLoginAuthSchema);
// Clear the dynamic claims cache.
await IdentityDynamicClaimsPrincipalContributorCache.ClearAsync(user.Id, user.TenantId);
await SignInManager.SignInAsync(user, isPersistent: true);
// Clear the dynamic claims cache.
await IdentityDynamicClaimsPrincipalContributorCache.ClearAsync(user.Id, user.TenantId);
return Redirect(ReturnUrl ?? "/");
}
}
Hi
Sorry, It can't be done without source code at the moment
H,
The Payment Gateway page only supports MVC UI
Hi,
Could you explain it in detail?
I will check it. Thanks.
Hi,
Could you share the steps to reproduce? thanks.