moved user bearer token middleware from userinfo route to lib for reuse