@@ -8,38 +8,38 @@ var passport = require('passport');
8
8
module . exports = function ( app ) {
9
9
// User Routes
10
10
var users = require ( '../../app/controllers/users.server.controller' ) ;
11
- app . get ( '/users/me' , users . me ) ;
12
- app . put ( '/users' , users . update ) ;
13
- app . post ( '/users/password' , users . changePassword ) ;
14
- app . del ( '/users/accounts' , users . removeOAuthProvider ) ;
11
+ app . route ( '/users/me' ) . get ( users . me ) ;
12
+ app . route ( '/users' ) . put ( users . update ) ;
13
+ app . route ( '/users/password' ) . post ( users . changePassword ) ;
14
+ app . route ( '/users/accounts' ) . delete ( users . removeOAuthProvider ) ;
15
15
16
16
// Setting up the users api
17
- app . post ( '/auth/signup' , users . signup ) ;
18
- app . post ( '/auth/signin' , users . signin ) ;
19
- app . get ( '/auth/signout' , users . signout ) ;
17
+ app . route ( '/auth/signup' ) . post ( users . signup ) ;
18
+ app . route ( '/auth/signin' ) . post ( users . signin ) ;
19
+ app . route ( '/auth/signout' ) . get ( users . signout ) ;
20
20
21
21
// Setting the facebook oauth routes
22
- app . get ( '/auth/facebook' , passport . authenticate ( 'facebook' , {
22
+ app . route ( '/auth/facebook' ) . get ( passport . authenticate ( 'facebook' , {
23
23
scope : [ 'email' ]
24
24
} ) ) ;
25
- app . get ( '/auth/facebook/callback' , users . oauthCallback ( 'facebook' ) ) ;
25
+ app . route ( '/auth/facebook/callback' ) . get ( users . oauthCallback ( 'facebook' ) ) ;
26
26
27
27
// Setting the twitter oauth routes
28
- app . get ( '/auth/twitter' , passport . authenticate ( 'twitter' ) ) ;
29
- app . get ( '/auth/twitter/callback' , users . oauthCallback ( 'twitter' ) ) ;
28
+ app . route ( '/auth/twitter' ) . get ( passport . authenticate ( 'twitter' ) ) ;
29
+ app . route ( '/auth/twitter/callback' ) . get ( users . oauthCallback ( 'twitter' ) ) ;
30
30
31
31
// Setting the google oauth routes
32
- app . get ( '/auth/google' , passport . authenticate ( 'google' , {
32
+ app . route ( '/auth/google' ) . get ( passport . authenticate ( 'google' , {
33
33
scope : [
34
34
'https://www.googleapis.com/auth/userinfo.profile' ,
35
35
'https://www.googleapis.com/auth/userinfo.email'
36
36
]
37
37
} ) ) ;
38
- app . get ( '/auth/google/callback' , users . oauthCallback ( 'google' ) ) ;
38
+ app . route ( '/auth/google/callback' ) . get ( users . oauthCallback ( 'google' ) ) ;
39
39
40
40
// Setting the linkedin oauth routes
41
- app . get ( '/auth/linkedin' , passport . authenticate ( 'linkedin' ) ) ;
42
- app . get ( '/auth/linkedin/callback' , users . oauthCallback ( 'linkedin' ) ) ;
41
+ app . route ( '/auth/linkedin' ) . get ( passport . authenticate ( 'linkedin' ) ) ;
42
+ app . route ( '/auth/linkedin/callback' ) . get ( users . oauthCallback ( 'linkedin' ) ) ;
43
43
44
44
// Finish by binding the user middleware
45
45
app . param ( 'userId' , users . userByID ) ;
0 commit comments