Commit Graph
56 Commits
Author SHA1 Message Date
Emil Ajdyna c428135fbc Move getToken method to utils 2016-03-31 21:26:09 +02:00
Emil Ajdyna 5ebdc028e4 Use authorization header instead of query parameter for jwt 2016-03-31 20:12:01 +02:00
Adrian Obelmejias acbdd519cf Use method from user model for generating token 2016-03-30 19:14:39 -04:00
Marc-Olivier Fiset 9e0621532b Remove the salt field from the user model, as it's redundant 2016-03-30 10:05:57 -04:00
Adrian Obelmejias f29e6e0432 Add docs 2016-03-19 11:26:39 -04:00
Adrian Obelmejias 6524773c53 Improve logging 2016-03-18 23:34:57 -04:00
Adrian Obelmejias d247a26716 Move token generation to model 2016-03-18 23:23:45 -04:00
Adrian Obelmejias 3539d66d50 Use getUser as middleware for code reuse 2016-03-18 23:14:57 -04:00
Adrian Obelmejias 16fa1ebd0a Pass user object within a user key 2016-03-18 23:04:14 -04:00
Adrian Obelmejias 8ffe8a40ae Replace object with proper array implementation 2016-03-18 22:59:01 -04:00
Adrian Obelmejias 0f3384eb57 Fix import 2016-03-16 20:32:51 -04:00
Adrian Obelmejias ae2bf52fcf Remove old controllers 2016-03-16 20:28:41 -04:00
Adrian Obelmejias e79a98f8da Move auth controllers to new modules 2016-03-16 20:28:26 -04:00
Adrian Obelmejias b08cef1ffc Add DELETE /users/:id 2016-03-16 20:21:16 -04:00
Adrian Obelmejias 2d8e171d07 Add PUT /users/:id 2016-03-16 20:18:27 -04:00
Adrian Obelmejias b10f6acf19 Update router generation with handlers 2016-03-16 20:18:00 -04:00
Adrian Obelmejias 462d584aa3 Add GET /users/:id route 2016-03-05 15:23:41 -05:00
Adrian Obelmejias 9f8a04e556 Add GET /users route 2016-03-05 15:13:41 -05:00
Adrian Obelmejias 1030f80360 Mount middleware stack per route 2016-03-05 15:11:02 -05:00
Adrian Obelmejias d4434e2ef8 Module intializer - generates routes and connects to controller 2016-03-05 14:12:09 -05:00
Adrian Obelmejias 184451f9fc Create router for /users 2016-03-05 13:38:08 -05:00
Adrian Obelmejias e96606acdb Add docs for DELETE /users/:id 2016-03-04 23:46:25 -05:00
Adrian Obelmejias ac7b8172ba Add docs for PUT /users/:id 2016-03-04 23:43:03 -05:00
Adrian Obelmejias 2f0c87ce91 Set error name to Unauthorized-Error 2016-03-04 23:42:51 -05:00
Adrian Obelmejias f5bfba49c5 Add docs for POST /users 2016-03-04 23:33:46 -05:00
Adrian Obelmejias 1b026949d2 Add docs for GET /user/:id 2016-03-04 23:23:25 -05:00
Adrian Obelmejias 1eae3a4c0e Define auth error 2016-03-04 23:17:12 -05:00
Adrian Obelmejias 87ea94b739 Mount documentation on /docs 2016-03-04 23:05:54 -05:00
Adrian Obelmejias 5aea701513 Change config/config.js to a default config/index.js 2016-03-04 22:40:39 -05:00
Adrian Obelmejias f8504f86ba Update auth docs 2016-03-04 22:26:21 -05:00
Adrian Obelmejias 7a81625c40 Add documentation for authentication route 2016-03-04 21:55:18 -05:00
Adrian Obelmejias 3d04313a37 Lint 2016-02-17 19:27:37 -05:00
Adrian Obelmejias 98ab1b8de6 Fix error handling for DEL method 2016-02-15 18:22:36 -05:00
Adrian Obelmejias 95f029c3e3 Fix error handling and return user within the user object or response 2016-02-15 18:19:39 -05:00
Adrian Obelmejias 2138890f07 Throw 404 instead of 500 for cast error when fetching user 2016-02-15 18:14:43 -05:00
Adrian Obelmejias 1dfc2fe826 Fix config prop name 2016-02-15 17:54:25 -05:00
Adrian Obelmejias 235e3caabe Use glob function instead of Glob constructor 2016-02-15 17:11:57 -05:00
Adrian Obelmejias 85f6518262 Fix missing async keyword on query 2016-02-15 17:04:29 -05:00
Adrian Obelmejias 6910b04e91 Register controllers from glob 2016-02-15 16:52:40 -05:00
Adrian Obelmejias f691bae41d Make user CRUD route's protected behind auth 2016-02-15 16:37:00 -05:00
Adrian Obelmejias 409520d9f1 Moved middleware to middleware directory 2016-02-15 16:36:18 -05:00
Adrian Obelmejias f3172adf77 Remove unnecesary error catching 2016-02-15 16:30:49 -05:00
Adrian Obelmejias 6f34ecf76a Fix token name 2016-02-11 19:51:31 -05:00
Adrian Obelmejias 24db4c2b55 Fix promise not resolving 2016-02-11 19:36:17 -05:00
Adrian Obelmejias d64742f36f add auth routes 2016-02-11 19:27:49 -05:00
Adrian Obelmejias 59264a030e Lint 2016-02-11 19:20:50 -05:00
Adrian Obelmejias bffdd32550 Use promises for flatter code 2016-02-11 19:20:45 -05:00
Adrian Obelmejias 2e40b09bba Made salt key not required
Mongoose's validation kept blocking the operation.
We need this to go through to the pre-save hook
2016-02-11 19:01:15 -05:00
Adrian Obelmejias 8b4cdd5886 Remove password and salt from response 2016-02-11 19:01:08 -05:00
Adrian Obelmejias caa61db6b1 Add user validation middleware 2016-02-11 18:38:16 -05:00