Ejemplo n.º 1
0
 public UserController(IClientAuthorizationData clientAuthorizationData, IUsersService usersService,
                       IMapper mapper)
 {
     _clientAuthorizationData = clientAuthorizationData;
     _usersService            = usersService;
     _mapper = mapper;
 }
Ejemplo 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);
        }
Ejemplo n.º 3
0
 public ProjectsService(IMongoDatabase database, IClientAuthorizationData clientAuthorizationData)
 {
     _clientAuthorizationData = clientAuthorizationData;
     _projectsDatabase        = database.GetCollection <Project>("projects");
 }
Ejemplo n.º 4
0
 public UsersService(IMongoDatabase database, IClientAuthorizationData clientAuthorizationData)
 {
     _clientAuthorizationData = clientAuthorizationData;
     _usersDatabase           = database.GetCollection <User>("users");
 }