Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Controller Authentication #305

Closed
jonnadams opened this issue Jul 5, 2014 · 2 comments
Closed

New Controller Authentication #305

jonnadams opened this issue Jul 5, 2014 · 2 comments
Labels

Comments

@jonnadams
Copy link

I'm relatively new to an angular and I have absolutely fell in love with this generator. I do have a question. How would I go about adding another clientside route that requires authentication? Could this be added to the "yo angular-fullstack:route" command? Thanks!

@JaKXz JaKXz added the question label Jul 5, 2014
@m4tta
Copy link

m4tta commented Jul 5, 2014

After running that generator command to create that new route you need to edit the routename.js file and add the following key to the options object on the route.

authenticate: true

so you end up with something like this

.when('/settings', {
  templateUrl: 'app/account/settings/settings.html',
  controller: 'SettingsCtrl',
  authenticate: true
});

ensure you are also protecting your server side routes too using the auth middleware.

@jonnadams
Copy link
Author

Perfect Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants