Managing user authentications and route access in angularjs