Beispiel #1
0
        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;
            }
        }
Beispiel #2
0
 public UploadService(DatabaseContext dbContext, SessionService sessionService)
 {
     this.dbContext      = dbContext;
     this.sessionService = sessionService;
 }
Beispiel #3
0
 public AuthService(IHttpContextAccessor httpContextAccessor, DatabaseContext dbContext, SessionService sessionService)
 {
     this.dbContext      = dbContext;
     this.context        = httpContextAccessor.HttpContext;
     this.sessionService = sessionService;
 }
Beispiel #4
0
 public ChatService(DatabaseContext dbContext, SessionService authService)
 {
     this.dbContext   = dbContext;
     this.authService = authService;
 }