second draft for extending auth middelware