public async Task <UserPorviderProofResponseModel> LoginProof(string providerToken, string userToken)
        {
            var provider = await _repositoryProvider.GetByToken(providerToken);

            if (provider == null)
            {
                throw new MRException <object>(-1, "Wrong provider token");
            }

            (var providerId, var userId) = ProviderTokenGenerator.DecryptToken(userToken);

            if (!provider.Id.Equals(providerId))
            {
                throw new MRException <object>(-1, "Wrong provider token");
            }

            var user = await _repositoryUser.GetFirst(x => x.Id == userId && x.State == MREntityState.Active);

            if (user == null)
            {
                throw new MRException <object>(-1, "User not found");
            }

            var providerLogin = new ProviderClientLogin
            {
                ProviderToken = providerToken,
                ClientToken   = userToken,
                Time          = DateTime.UtcNow
            };

            if (provider.Clients == null)
            {
                provider.Clients = new List <ProviderClient>();
                await _repositoryProvider.Replace(provider);
            }

            var providerClient = provider.Clients.FirstOrDefault(x => x.UserId == user.Id);

            if (providerClient == null)
            {
                providerClient = new ProviderClient
                {
                    UserId = user.Id,
                    Email  = user.Email,
                    Roles  = provider.Options.DefaultRoles,
                    Logins = new List <ProviderClientLogin> {
                        providerLogin
                    }
                };

                provider.Clients.Add(providerClient);

                await _repositoryProvider.AddClient(provider.Id, providerClient);
            }
            else
            {
                await _repositoryProvider.AddClientLogin(provider.Id, providerClient.UserId, providerLogin);
            }

            var model = _mapper.Map <UserPorviderProofResponseModel>(user);

            model.Roles            = providerClient.Roles;
            model.IsEmailConfirmed = await _managerUser.IsEmailConfirmedAsync(user);

            model.IsEmailOnChange = await _repositoryEmailChangeUnit.Any(x => x.UserId == user.Id && x.Status == Infrastructure.Entity.Enum.EmailChangeResult.NEW);

            return(model);
        }