public async Task Invoke(HttpContext context, SessionService sessionService, AuthService authService) { var cookie = context.Request.Cookies[AuthService.AUTH_SESSION]; var session = authService.AuthenticateSession(); if (session != null) { sessionService.SetSession(session); await next(context); } else if (IsPublicPath(context)) { await next(context); } else { context.Response.StatusCode = 401; } }
public UploadService(DatabaseContext dbContext, SessionService sessionService) { this.dbContext = dbContext; this.sessionService = sessionService; }
public AuthService(IHttpContextAccessor httpContextAccessor, DatabaseContext dbContext, SessionService sessionService) { this.dbContext = dbContext; this.context = httpContextAccessor.HttpContext; this.sessionService = sessionService; }
public ChatService(DatabaseContext dbContext, SessionService authService) { this.dbContext = dbContext; this.authService = authService; }