| 
									
										
										
										
											2017-07-13 11:39:07 -07:00
										 |  |  | const successRedirect = '/'; | 
					
						
							|  |  |  | const failureRedirect = '/signin'; | 
					
						
							|  |  |  | const linkSuccessRedirect = '/settings'; | 
					
						
							|  |  |  | const linkFailureRedirect = '/settings'; | 
					
						
							| 
									
										
										
										
											2016-06-23 20:05:30 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | export default { | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |   local: { | 
					
						
							|  |  |  |     provider: 'local', | 
					
						
							|  |  |  |     module: 'passport-local', | 
					
						
							|  |  |  |     usernameField: 'email', | 
					
						
							|  |  |  |     passwordField: 'password', | 
					
						
							|  |  |  |     authPath: '/auth/local', | 
					
						
							|  |  |  |     successRedirect: successRedirect, | 
					
						
							| 
									
										
										
										
											2015-06-09 17:22:14 -07:00
										 |  |  |     failureRedirect: '/email-signin', | 
					
						
							|  |  |  |     session: true, | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |     failureFlash: true | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   'facebook-login': { | 
					
						
							|  |  |  |     provider: 'facebook', | 
					
						
							|  |  |  |     module: 'passport-facebook', | 
					
						
							|  |  |  |     clientID: process.env.FACEBOOK_ID, | 
					
						
							|  |  |  |     clientSecret: process.env.FACEBOOK_SECRET, | 
					
						
							|  |  |  |     authPath: '/auth/facebook', | 
					
						
							|  |  |  |     callbackURL: '/auth/facebook/callback', | 
					
						
							|  |  |  |     callbackPath: '/auth/facebook/callback', | 
					
						
							|  |  |  |     successRedirect: successRedirect, | 
					
						
							|  |  |  |     failureRedirect: failureRedirect, | 
					
						
							|  |  |  |     scope: ['email'], | 
					
						
							|  |  |  |     failureFlash: true | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   'facebook-link': { | 
					
						
							|  |  |  |     provider: 'facebook', | 
					
						
							|  |  |  |     module: 'passport-facebook', | 
					
						
							|  |  |  |     clientID: process.env.FACEBOOK_ID, | 
					
						
							|  |  |  |     clientSecret: process.env.FACEBOOK_SECRET, | 
					
						
							|  |  |  |     authPath: '/link/facebook', | 
					
						
							|  |  |  |     callbackURL: '/link/facebook/callback', | 
					
						
							|  |  |  |     callbackPath: '/link/facebook/callback', | 
					
						
							| 
									
										
										
										
											2017-07-13 11:39:07 -07:00
										 |  |  |     successRedirect: linkSuccessRedirect, | 
					
						
							| 
									
										
										
										
											2015-08-18 13:08:27 -07:00
										 |  |  |     failureRedirect: linkFailureRedirect, | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |     scope: ['email', 'user_likes'], | 
					
						
							|  |  |  |     link: true, | 
					
						
							|  |  |  |     failureFlash: true | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   'google-login': { | 
					
						
							|  |  |  |     provider: 'google', | 
					
						
							| 
									
										
										
										
											2015-08-16 06:51:08 -07:00
										 |  |  |     authScheme: 'oauth2', | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |     module: 'passport-google-oauth2', | 
					
						
							|  |  |  |     clientID: process.env.GOOGLE_ID, | 
					
						
							|  |  |  |     clientSecret: process.env.GOOGLE_SECRET, | 
					
						
							|  |  |  |     authPath: '/auth/google', | 
					
						
							|  |  |  |     callbackURL: '/auth/google/callback', | 
					
						
							|  |  |  |     callbackPath: '/auth/google/callback', | 
					
						
							|  |  |  |     successRedirect: successRedirect, | 
					
						
							|  |  |  |     failureRedirect: failureRedirect, | 
					
						
							|  |  |  |     scope: ['email', 'profile'], | 
					
						
							|  |  |  |     failureFlash: true | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   'google-link': { | 
					
						
							|  |  |  |     provider: 'google', | 
					
						
							| 
									
										
										
										
											2015-08-16 06:51:08 -07:00
										 |  |  |     authScheme: 'oauth2', | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |     module: 'passport-google-oauth2', | 
					
						
							|  |  |  |     clientID: process.env.GOOGLE_ID, | 
					
						
							|  |  |  |     clientSecret: process.env.GOOGLE_SECRET, | 
					
						
							|  |  |  |     authPath: '/link/google', | 
					
						
							|  |  |  |     callbackURL: '/link/google/callback', | 
					
						
							|  |  |  |     callbackPath: '/link/google/callback', | 
					
						
							| 
									
										
										
										
											2017-07-13 11:39:07 -07:00
										 |  |  |     successRedirect: linkSuccessRedirect, | 
					
						
							| 
									
										
										
										
											2015-08-18 13:08:27 -07:00
										 |  |  |     failureRedirect: linkFailureRedirect, | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |     scope: ['email', 'profile'], | 
					
						
							|  |  |  |     link: true, | 
					
						
							|  |  |  |     failureFlash: true | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   'twitter-login': { | 
					
						
							|  |  |  |     provider: 'twitter', | 
					
						
							|  |  |  |     authScheme: 'oauth', | 
					
						
							|  |  |  |     module: 'passport-twitter', | 
					
						
							|  |  |  |     authPath: '/auth/twitter', | 
					
						
							|  |  |  |     callbackURL: '/auth/twitter/callback', | 
					
						
							|  |  |  |     callbackPath: '/auth/twitter/callback', | 
					
						
							|  |  |  |     successRedirect: successRedirect, | 
					
						
							|  |  |  |     failureRedirect: failureRedirect, | 
					
						
							|  |  |  |     consumerKey: process.env.TWITTER_KEY, | 
					
						
							|  |  |  |     consumerSecret: process.env.TWITTER_SECRET, | 
					
						
							|  |  |  |     failureFlash: true | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   'twitter-link': { | 
					
						
							|  |  |  |     provider: 'twitter', | 
					
						
							|  |  |  |     authScheme: 'oauth', | 
					
						
							|  |  |  |     module: 'passport-twitter', | 
					
						
							|  |  |  |     authPath: '/link/twitter', | 
					
						
							|  |  |  |     callbackURL: '/link/twitter/callback', | 
					
						
							|  |  |  |     callbackPath: '/link/twitter/callback', | 
					
						
							| 
									
										
										
										
											2017-07-13 11:39:07 -07:00
										 |  |  |     successRedirect: linkSuccessRedirect, | 
					
						
							| 
									
										
										
										
											2015-08-18 13:08:27 -07:00
										 |  |  |     failureRedirect: linkFailureRedirect, | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |     consumerKey: process.env.TWITTER_KEY, | 
					
						
							|  |  |  |     consumerSecret: process.env.TWITTER_SECRET, | 
					
						
							| 
									
										
										
										
											2015-08-12 16:25:52 -07:00
										 |  |  |     link: true, | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |     failureFlash: true | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   'linkedin-login': { | 
					
						
							|  |  |  |     provider: 'linkedin', | 
					
						
							| 
									
										
										
										
											2015-06-17 21:43:22 -07:00
										 |  |  |     authScheme: 'oauth2', | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |     module: 'passport-linkedin-oauth2', | 
					
						
							|  |  |  |     authPath: '/auth/linkedin', | 
					
						
							|  |  |  |     callbackURL: '/auth/linkedin/callback', | 
					
						
							|  |  |  |     callbackPath: '/auth/linkedin/callback', | 
					
						
							|  |  |  |     successRedirect: successRedirect, | 
					
						
							|  |  |  |     failureRedirect: failureRedirect, | 
					
						
							|  |  |  |     clientID: process.env.LINKEDIN_ID, | 
					
						
							|  |  |  |     clientSecret: process.env.LINKEDIN_SECRET, | 
					
						
							| 
									
										
										
										
											2015-06-17 22:05:37 -07:00
										 |  |  |     scope: ['r_basicprofile', 'r_emailaddress'], | 
					
						
							| 
									
										
										
										
											2015-06-17 21:43:22 -07:00
										 |  |  |     authOptions: { | 
					
						
							|  |  |  |       state: process.env.LINKEDIN_STATE | 
					
						
							| 
									
										
										
										
											2015-06-17 20:59:35 -07:00
										 |  |  |     }, | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |     failureFlash: true | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   'linkedin-link': { | 
					
						
							|  |  |  |     provider: 'linkedin', | 
					
						
							| 
									
										
										
										
											2015-06-17 21:43:22 -07:00
										 |  |  |     authScheme: 'oauth2', | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |     module: 'passport-linkedin-oauth2', | 
					
						
							|  |  |  |     authPath: '/link/linkedin', | 
					
						
							|  |  |  |     callbackURL: '/link/linkedin/callback', | 
					
						
							|  |  |  |     callbackPath: '/link/linkedin/callback', | 
					
						
							| 
									
										
										
										
											2017-07-13 11:39:07 -07:00
										 |  |  |     successRedirect: linkSuccessRedirect, | 
					
						
							| 
									
										
										
										
											2015-08-18 13:08:27 -07:00
										 |  |  |     failureRedirect: linkFailureRedirect, | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |     clientID: process.env.LINKEDIN_ID, | 
					
						
							|  |  |  |     clientSecret: process.env.LINKEDIN_SECRET, | 
					
						
							| 
									
										
										
										
											2015-06-17 22:05:37 -07:00
										 |  |  |     scope: ['r_basicprofile', 'r_emailaddress'], | 
					
						
							| 
									
										
										
										
											2015-06-17 20:59:35 -07:00
										 |  |  |     authOptions: { | 
					
						
							| 
									
										
										
										
											2015-06-17 21:43:22 -07:00
										 |  |  |       state: process.env.LINKEDIN_STATE | 
					
						
							| 
									
										
										
										
											2015-06-17 20:59:35 -07:00
										 |  |  |     }, | 
					
						
							| 
									
										
										
										
											2015-08-12 16:25:52 -07:00
										 |  |  |     link: true, | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |     failureFlash: true | 
					
						
							| 
									
										
										
										
											2015-08-01 08:38:42 -07:00
										 |  |  |   }, | 
					
						
							|  |  |  |   'github-login': { | 
					
						
							|  |  |  |     provider: 'github', | 
					
						
							|  |  |  |     authScheme: 'oauth2', | 
					
						
							|  |  |  |     module: 'passport-github', | 
					
						
							|  |  |  |     authPath: '/auth/github', | 
					
						
							|  |  |  |     callbackURL: '/auth/github/callback', | 
					
						
							|  |  |  |     callbackPath: '/auth/github/callback', | 
					
						
							|  |  |  |     successRedirect: successRedirect, | 
					
						
							|  |  |  |     failureRedirect: failureRedirect, | 
					
						
							|  |  |  |     clientID: process.env.GITHUB_ID, | 
					
						
							|  |  |  |     clientSecret: process.env.GITHUB_SECRET, | 
					
						
							|  |  |  |     failureFlash: true | 
					
						
							| 
									
										
										
										
											2015-08-10 23:38:10 -07:00
										 |  |  |   }, | 
					
						
							|  |  |  |   'github-link': { | 
					
						
							|  |  |  |     provider: 'github', | 
					
						
							|  |  |  |     authScheme: 'oauth2', | 
					
						
							|  |  |  |     module: 'passport-github', | 
					
						
							|  |  |  |     authPath: '/link/github', | 
					
						
							| 
									
										
										
										
											2015-08-12 21:44:18 -07:00
										 |  |  |     callbackURL: '/auth/github/callback/link', | 
					
						
							|  |  |  |     callbackPath: '/auth/github/callback/link', | 
					
						
							| 
									
										
										
										
											2017-07-13 11:39:07 -07:00
										 |  |  |     successRedirect: linkSuccessRedirect, | 
					
						
							| 
									
										
										
										
											2015-08-18 13:08:27 -07:00
										 |  |  |     failureRedirect: linkFailureRedirect, | 
					
						
							| 
									
										
										
										
											2015-08-10 23:38:10 -07:00
										 |  |  |     clientID: process.env.GITHUB_ID, | 
					
						
							|  |  |  |     clientSecret: process.env.GITHUB_SECRET, | 
					
						
							| 
									
										
										
										
											2015-08-12 16:25:52 -07:00
										 |  |  |     link: true, | 
					
						
							| 
									
										
										
										
											2016-10-01 07:11:29 +03:00
										 |  |  |     failureFlash: true, | 
					
						
							| 
									
										
										
										
											2018-01-12 11:10:17 -08:00
										 |  |  |     successFlash: [ | 
					
						
							|  |  |  |       'We\'ve updated your profile based ', | 
					
						
							|  |  |  |       'on your your GitHub account.' | 
					
						
							|  |  |  |     ].join('') | 
					
						
							| 
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 |  |  |   } | 
					
						
							|  |  |  | }; |