public async Task <IActionResult> ConfirmEmail(string protectedSequence, string code, string returnUrl = null)
        {
            try
            {
                if (string.IsNullOrEmpty(protectedSequence))
                {
                    throw new ArgumentOutOfRangeException(nameof(protectedSequence));
                }

                protectedSequence = _urlEncoderWrapper.UrlDecode(protectedSequence);
                var user = await _userManager.FindByEmailAsync(_protector.Unprotect(protectedSequence));

                var identityResult = await _userManager.ConfirmEmailAsync(user, code);

                if (identityResult.Succeeded)
                {
                    _companyManager.SetAdmin(Guid.Parse(user.Id), user.CompanyId);
                    return(RedirectToAction(nameof(SignIn), returnUrl));
                }

                return(NotFound());
            }
            catch (Exception exp)
            {
                _logger.LogError(exp.Message);
                return(NotFound());
            }
        }