@ -11,9 +11,9 @@ const cookieParser = require('cookie-parser');
const baseURL = function ( ) {
switch ( process . env . FLYLOCAL_ENV ) {
case "prod" :
return process . env . PROD_ENV ;
return process . env . PROD_URL ;
case "dev" :
return process . env . DEV_ENV ;
return process . env . DEV_URL ;
case "local" :
return "http://" + process . env . LOCAL_IP + ":" + process . env . LOCAL_PORT ;
default :
@ -223,6 +223,9 @@ app.get("/", (req, res) => {
} ) ;
app . post ( "/auth" , formParser , ( req , res ) => {
console . log ( baseURL ( ) ) ;
//console.log(req.body);
portier . authenticate ( req . body . email ) . then ( ( authUrl ) => {
if ( req . body . redirect && typeof req . body . redirect !== 'undefined' ) {
@ -236,6 +239,8 @@ app.post("/auth", formParser, (req, res) => {
app . post ( "/verify" , formParser , ( req , res ) => {
//console.log(req.body);
console . log ( baseURL ( ) ) ;
portier . verify ( req . body . id_token ) . then ( ( email ) => {
const redirectButton = ( req . query . redirect && typeof req . query . redirect !== 'undefined' ) ? ` <a class="btn btn--primary" href=" ${ req . query . redirect } ">back to your flight</a> ` : ` <a class="btn btn--primary" href=" ${ baseURL ( ) } ">back to the map</a> ` ;