2018-10-24 00:24:48 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								import { auth0 } from '../../config/secrets';
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-13 12:14:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								import { homeLocation, apiLocation } from '../../config/env';
							 | 
						
					
						
							
								
									
										
										
										
											2018-10-24 00:24:48 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								const { clientID, clientSecret, domain } = auth0;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-08 08:15:36 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const successRedirect = `${homeLocation}/learn`;
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-13 12:14:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const failureRedirect = `${homeLocation}/signin`;
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-23 20:05:30 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								export default {
							 | 
						
					
						
							
								
									
										
										
										
											2018-10-30 18:17:07 -03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  devlogin: {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    authScheme: 'mock',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    provider: 'dev',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    module: 'passport-mock-strategy'
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  },
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  local: {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    provider: 'local',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    module: 'passport-local',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    usernameField: 'email',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    passwordField: 'password',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    authPath: '/auth/local',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    successRedirect: successRedirect,
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-13 20:18:10 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    failureRedirect: failureRedirect,
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-09 17:22:14 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    session: true,
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    failureFlash: true
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  },
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-17 03:36:11 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  'auth0-login': {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    provider: 'auth0',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    module: 'passport-auth0',
							 | 
						
					
						
							
								
									
										
										
										
											2018-10-24 00:24:48 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    clientID,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    clientSecret,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    domain,
							 | 
						
					
						
							
								
									
										
										
										
											2019-02-13 12:14:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    cookieDomain: process.env.COOKIE_DOMAIN || 'localhost',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    callbackURL: `${apiLocation}/auth/auth0/callback`,
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-17 03:36:11 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    authPath: '/auth/auth0',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    callbackPath: '/auth/auth0/callback',
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-20 13:40:15 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    useCustomCallback: true,
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 17:03:00 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    passReqToCallback: true,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    state: false,
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-17 03:36:11 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    successRedirect: successRedirect,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    failureRedirect: failureRedirect,
							 | 
						
					
						
							
								
									
										
										
										
											2018-06-28 20:27:15 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    scope: ['openid profile email'],
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-17 03:36:11 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    failureFlash: true
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-04 10:52:12 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								};
							 |