public AccountsAPIController(
     IUserDetailsService userService,
     IOptions <AppSettings> appSettings)
 {
     UserService = userService;
     AppSettings = appSettings.Value;
 }
Beispiel #2
0
        /// <summary>
        /// Checks or creates a twitter based login.
        /// </summary>
        /// <param name="authentication"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        public RegisteredUser AuthenticateTwitterAccount(TwitterAuthentication authentication, string userName, int twitterId)
        {
            //see if there is alraedy an account.
            RegisteredUser returnedUser = _userDao.GetUserByUserName(userName);

            //check if its new
            if (returnedUser == null)
            {
                //save the user details
                returnedUser = new RegisteredUser()
                {
                    AuthDetails = authentication,
                    UserName    = userName,
                    TwitterId   = twitterId
                };
                IUserDetailsService userDetailsService = ServiceLayer.UserDetailsService;
                userDetailsService.CreateUser(returnedUser);

                //setup the indexing of their tweets
                IIndexQueuerService indexQueuerService = ServiceLayer.IndexQueuerService;
                indexQueuerService.QueueUserStreamIndex(returnedUser);
            }
            else
            {
                //make sure the tokens match
                if (!returnedUser.AuthDetails.AccessToken.Equals(authentication.AccessToken))
                {
                    return(null);
                }
            }

            return(returnedUser);
        }
 public UserSearchHandler(ILogger logger, IUserService userService, IUserDetailsService userDetailsService)
 {
     _logger             = logger.ForContext("SourceContext", this.GetType().Name);
     _userService        = userService;
     _userDetailsService = userDetailsService;
     userResponse        = new List <UserDetailsResponse>();
 }
Beispiel #4
0
 public AccountController(IUserService usrSrv, IUserRoleRelService usrRoleSrv, IRoleService roleSrv, IOperationService optSrv, IUserDetailsService usrDetailSrv)
     : base(optSrv)
 {
     _usrSrv       = usrSrv;
     _usrRoleSrv   = usrRoleSrv;
     _roleSrv      = roleSrv;
     _usrDetailSrv = usrDetailSrv;
 }
 public ManageController(IPromoCodeService promoCodeService, ICookieCartService cookieCartService, ICartService cartService, IProductInCartService productInCartService, IUserDetailsService userDetailsService)
 {
     PromoCodeService      = promoCodeService;
     CookieCartService     = cookieCartService;
     CartService           = cartService;
     ProductsInCartService = productInCartService;
     UserDetailsService    = userDetailsService;
 }
Beispiel #6
0
 public UserController(IConfiguration config, ILogger <UserController> logger, IUserDetailsService userService, IOptions <JwtAuthentication> jwtAuthentication, IHttpContextAccessor httpContextAccessor,
                       IImageHandler imageHandler)
 {
     _config              = config;
     _logger              = logger;
     _userService         = userService;
     _jwtAuthentication   = jwtAuthentication ?? throw new ArgumentNullException(nameof(jwtAuthentication));
     _httpContextAccessor = httpContextAccessor;
     _helper              = new AuthenticationHelper();
     _imageHandler        = imageHandler;
 }
        public UsersController(IUserDetailsService userDetailsService, INotificationService notificationService, IPrefixesService prefixesService, IBranchService branchService)
        {
            this.userDetailsService  = userDetailsService;
            this.notificationService = notificationService;
            this.prefixesService     = prefixesService;
            this.branchService       = branchService;
            //this.dashboardService = dashboardService;

            //Logged in user details
            session = (SessionDataModel)System.Web.HttpContext.Current.Session[Constants.SessionKeys.SessionUser];
        }
Beispiel #8
0
 public UserService(UserManager <User> userManager, IUserDetailsService userDetailsService,
                    IJwtFactory jwtFactory, RoleManager <Role> roleManager, IMapper mapper, IConfiguration configuration,
                    ICacheService cacheService, IUnitOfWork unitOfWork)
 {
     this.userManager        = userManager;
     this.roleManager        = roleManager;
     this.userDetailsService = userDetailsService;
     this.jwtFactory         = jwtFactory;
     this.mapper             = mapper;
     this.cacheService       = cacheService;
     this.unitOfWork         = unitOfWork;
     this.configuration      = configuration;
 }
Beispiel #9
0
 public Application(
     IFileService fileService,
     ITextLineUtilityService textLineUtilityService,
     IUserDetailsService userDetailsService,
     IBlobServiceFactory blobServiceFactory,
     UserDetailsConfiguration userDetailsConfigurations,
     ConsoleText consoleText)
 {
     _fileService               = fileService;
     _textLineUtilityService    = textLineUtilityService;
     _userDetailsService        = userDetailsService;
     _blobServiceFactory        = blobServiceFactory;
     _userDetailsConfigurations = userDetailsConfigurations;
     _consoleText               = consoleText;
 }
        public async Task <ActionResult> Register(RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = new ApplicationUser {
                    UserName = model.Email, Email = model.Email
                };
                var result = await UserManager.CreateAsync(user, model.Password);

                if (result.Succeeded)
                {
                    await SignInManager.SignInAsync(user, isPersistent : false, rememberBrowser : false);

                    // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771
                    // Send an email with this link
                    // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
                    // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
                    // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>");

                    unitOfWorkFactory  = new UnitOfWorkFactory(new Config());
                    userDetailsService = new UserDetailsService(unitOfWorkFactory);

                    UserDetails userDetails = new UserDetails()
                    {
                        ID = new Guid(user.Id)
                    };
                    userDetailsService.Create(userDetails);

                    return(RedirectToAction("Create", "UserDetails"));
                }
                AddErrors(result);
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
 public CatalogueController(ICartService cartService, IPromoCodeService promoCodeService, ICookieCartService cookieCartService, IUserDetailsService userDetailsService, IOrderService orderService, IApplicationUserService userService, IProductInCartService productsInCartService, IProductCategoryService categoryService, IProductService productService, IPromoService promosService)
 {
     this.CookieCartService     = cookieCartService;
     this.CartService           = cartService;
     this.PromoCodeService      = promoCodeService;
     this.CategoryService       = categoryService;
     this.UserDetailsService    = userDetailsService;
     this.OrderService          = orderService;
     this.ProductService        = productService;
     this.PromosService         = promosService;
     this.UserService           = userService;
     this.ProductsInCartService = productsInCartService;
 }
 public UserController(IRepoDetailsService repoUser, IUserDetailsService user)
 {
     this._repoUser = repoUser;
     this._user     = user;
 }
 public UserDetailsHandler(ILogger logger, IUserService userService, IUserDetailsService userDetailsService)
 {
     _logger             = logger.ForContext("SourceContext", this.GetType().Name);
     _userDetailsService = userDetailsService;
 }
Beispiel #14
0
 public UserDetailsController(IUserDetailsService service)
 {
     this._service = service;
 }
 public UserDetailsController(IUserDetailsService userDetailsService, IMapper mapper, IHttpContextAccessor httpContextAccessor)
 {
     _userDetailsService  = userDetailsService;
     _mapper              = mapper;
     _httpContextAccessor = httpContextAccessor;
 }
 public UserDetailsController()
 {
     unitOfWorkFactory  = new UnitOfWorkFactory(new Config());
     userDetailsService = new UserDetailsService(unitOfWorkFactory);
 }
Beispiel #17
0
 public UserDetailViewModel(IUserDetailsService userDetailsService)
 {
     _userDetailsService = userDetailsService;
 }
Beispiel #18
0
 public UserDetailsController(IUserDetailsService userDetailsService)
 {
     this.userDetailsService = userDetailsService;
 }
 public UserProfileController(IUserDetailsService userDetails)
 {
     _userDetails = userDetails;
 }
 public UserDetailsController(IUserDetailsService usrDetailSrv, IOperationService optSrv)
     : base(optSrv)
 {
     _usrDetailSrv = usrDetailSrv;
 }
Beispiel #21
0
 public UserDetailsController(IUserDetailsService userDetailsService, IMapper mapper, ICityService cityService)
 {
     _userDetailsService = userDetailsService;
     _mapper             = mapper;
     _cityService        = cityService;
 }
Beispiel #22
0
 public ContentController(IUserDetailsService userDetails)
 {
     this.userDetails = userDetails;
 }