public UserController(IClientAuthorizationData clientAuthorizationData, IUsersService usersService,
                       IMapper mapper)
 {
     _clientAuthorizationData = clientAuthorizationData;
     _usersService            = usersService;
     _mapper = mapper;
 }
Esempio n. 2
0
        public async Task InvokeAsync(HttpContext context, IClientAuthorizationData clientAuthorizationData)
        {
            var claimsIdentity = context.User.Identity as ClaimsIdentity;
            var userId         = claimsIdentity?.FindFirst(ClaimTypes.Name);

            clientAuthorizationData.UserId = userId?.Value;
            await _next.Invoke(context);
        }
 public ProjectsService(IMongoDatabase database, IClientAuthorizationData clientAuthorizationData)
 {
     _clientAuthorizationData = clientAuthorizationData;
     _projectsDatabase        = database.GetCollection <Project>("projects");
 }
Esempio n. 4
0
 public UsersService(IMongoDatabase database, IClientAuthorizationData clientAuthorizationData)
 {
     _clientAuthorizationData = clientAuthorizationData;
     _usersDatabase           = database.GetCollection <User>("users");
 }