login middleware for graphite