TrackYourself/track-yourself — pull request #25 by aisapatino (2014-06-19 21:46:11+00:00)
Title: Auth

### Auth

* removed jwt code
* added auth to base angular page
* added auth to api
* made it so register will log the person in on success
* login and register successes redir to angular home page (/app)
* wrote auth tests
* register works, logs in automatically, redirects to dashboard (/app for now)
* login works and redirects to dashboard (/app for now)
* can access public pages while logged out (home, login, register,)
* cannot access private pages while logged out (angular, api)

### Sleep module updates

* Added a user field to the schema which is an `ObjectId` type (matching the auto _id that mongo gives objects)
* Use `/api` prefix in route urls
* Updated api routes to not expect user as part of url, it will be available as `req.user`

### Misc non-auth things:

* switched to grunt-mocha-test which does the same thing as grunt-simple-mocha but prints out stacktraces when there's an error
* removed IE from karma's list of browsers because i think none of us have it, and it was making phantomjs run twice for me.

### To do

* set up separate unit & integration test tasks for mochaTest
* figure out how to make assets (css, images) public while angular stays auth-only
* get flash working (commented out for now)
* clean up profile code -- probably removing from backend and having angular dashboard & settings pages instead. right now, profile is commented out, the admin page is there but probably doesn't work.