Ejemplo n.º 1
0
        public async Task <bool> CheckEmailCodeExists(string email, string code, CodeReason codeReason, bool deactivate = true)
        {
            var dbCode = await _codeRepository.GetByEmail(email, code, codeReason);

            if (deactivate)
            {
                dbCode.IsActive = false;
                await _codeRepository.Update(dbCode);
            }

            return(dbCode?.IsActive == true && dbCode.DateExpiration > DateTime.UtcNow);
        }