Updated auth middleware with BasicAuthFunc

I decided to pass the request as well with the callback, this gives the user the freedom to chose how to pass on the callback.