Open Closed

Login issue with ABP commercial #5538


User avatar
0
SGajjelli created

Hey, We are unable to log in with a newly created user from the application and below is the entry created in abp core database. Please let us know that anything I'm missing.

  • ABP Framework version: ABP CLI 7.3.0
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • Steps to reproduce the issue: Create a new user and try to login

5 Answer(s)
  • User Avatar
    0
    nlachmuthDev created

    Hi,

    do you get any error messages or logs inside the api host when the user tries to log in?

    From what i see the user is fine. Do you have enabled that the user must confirm his/her email before he can login? You could set EmailConfirmed to 1 and try again.

  • User Avatar
    0
    SGajjelli created

    Hi ,

    tried the above solution but still facing same issue and below is the error

    2023-08-10 03:56:56.995 +00:00 [INF] Executed page /Account/Register in 836.3275ms 2023-08-10 03:56:56.995 +00:00 [INF] Executed endpoint '/Account/Register' 2023-08-10 03:56:57.097 +00:00 [ERR] An unhandled exception has occurred while executing the request. System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.Sockets.SocketException (10013): An attempt was made to access a socket in a way forbidden by its access permissions. at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state) --- End of stack trace from previous location ---

    Thanks

  • User Avatar
    0
    nlachmuthDev created

    The logs you provided show that the system cannot send mails. Please verify that the smtp settings are configured correctly.

  • User Avatar
    0
    mithun created

    Any settings to disable email feature during user registration process?

  • User Avatar
    0
    nlachmuthDev created

    There is no setting to disable the email confirmation during user registration.

    If you want to disable the sending of the email confirmation you would need to override the AccountAppService and overide the RegisterAsync-Method like this:

    public override async Task<IdentityUserDto> RegisterAsync(RegisterDto input)
    {
        await CheckSelfRegistrationAsync();
    
        if (await UseCaptchaOnRegistration())
        {
            var reCaptchaValidator = await RecaptchaValidatorFactory.CreateAsync();
            await reCaptchaValidator.ValidateAsync(input.CaptchaResponse);
        }
    
        await IdentityOptions.SetAsync();
    
        var user = new IdentityUser(GuidGenerator.Create(), input.UserName, input.EmailAddress, CurrentTenant.Id);
    
        input.MapExtraPropertiesTo(user);
    
        (await UserManager.CreateAsync(user, input.Password)).CheckErrors();
        (await UserManager.AddDefaultRolesAsync(user)).CheckErrors();
        
        //disable sending email confirmation mail for registrations
        //if (!user.EmailConfirmed)
        //{
        //    await SendEmailConfirmationTokenAsync(user, input.AppName, input.ReturnUrl, input.ReturnUrlHash);
        //}
    
        return ObjectMapper.Map<IdentityUser, IdentityUserDto>(user);
    }
    
Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38