added the option to pass a function as express credentials basicAuth