fnakstad / angular-client-side-auth

One way to implement authentication/authorization in Angular applications
http://angular-client-side-auth.herokuapp.com/
MIT License
1.63k stars 346 forks source link

Update controllers.js #29

Closed aozkan closed 11 years ago

aozkan commented 11 years ago

Inside the RegisterCtrl changed the following:

$scope.user = Auth.userRoles.user; (before) $scope.user = Auth.user; (after)

I did not see userRoles with a user property inside the Auth service. I could be wrong please have a look.

Thanks.

fnakstad commented 11 years ago

Hi aozkan, and thanks for the pull request :) However, in this case I'll have to stick with the old code. The role property set on the $scope in the beginning of the RegisterCtrl is the "default" role value of the form when registering a new user. From your pull request it looks like you're trying to set that scope value to the current user given by the Auth service which would be wrong. If you make that change you will probably see that once you load the /register route no user role will be selected by default.