Пример #1
0
        public Response Get(string mail)
        {
            var uuid = GetUUIDFromHeader();

            if (string.IsNullOrWhiteSpace(uuid))
            {
                return(_utilsServices.GetResponse(ResponseType.UnAuthorized));
            }

            var user      = _usersExtensionsServices.GetUserByMail(mail);
            var flowToUse = FlowType.Website;

            if (user != null)
            {
                var data = new Dictionary <string, string>();
                if (!string.IsNullOrEmpty(uuid))
                {
                    data.Add("uuid", uuid);// uuid used only by mobile channel
                    flowToUse = FlowType.App;
                }
                // create and send an OTP (this may overwrite any previous OTP for the user)
                _nonceService.SendNewOTP(user, data, DeliveryChannelType.Email, flowToUse);
                return(_utilsServices.GetResponse(ResponseType.Success));
            }

            return(_utilsServices.GetResponse(ResponseType.UnAuthorized));
        }
        public TemplatePart GetTemplateByUserEmailFavoriteCulture(int id, string email)
        {
            var user = _usersExtensionsServices.GetUserByMail(email.Split(';')[0]);

            return(GetTemplate(id, user.ContentItem.As <FavoriteCulturePart>().Culture));
        }