googlearchive / generator-angularfire

Yeoman generator for AngularFire: Angular + Firebase apps
190 stars 52 forks source link

yo angularfire:route auth required option does not seem to work #14

Closed wsgavin closed 9 years ago

wsgavin commented 10 years ago

generator-angularfire 0.8.2-7

I have tried variations of the yo angularfire:route command with options to require auth but it does not seem to catch e.g. yo angularfire:route myroute --auth-required. The router/index.js code suggests this is possible.

var whenMethod = this.env.options.authRequired? 'whenAuthenticated' : 'when';

I expected that --auth-required would be enough but tried all the options below for good measure.

--auth
--auth-required
--authRequired
--auth=true
--auth-required=true
--authRequired=true

Thoughts?

katowulf commented 10 years ago

this.env.options is not set from the command line but an internal structure. It will probably make it into the next release as an option for the route subgenerator. For now, simply open app/scripts/routes.js and change .when to .whenAuthenticated for the correct route. Cheers.

wsgavin commented 10 years ago

Thanks.