Proposed improvement to user authentication for the MEAN boilerplate. See linnovate/mean#121
- An express route for
/auth/<service_provider>
uses passport to redirect to the oauth service provider - The OAuth provider redirects back to
/auth/<service_provider>/callback
- Finally, Express redirects to
/
. Once authenticated, user data is available as JSON from/users/me
.
- There is a main controller set on the body element,
MainCtrl
. - It calls the
login
method on a service,AuthService
.AuthService.login()
attempts to make an Angular$http
request to/users/me
.