From 18ff4c9d1ff1bff5959c1b9f976cbf3c91c2d754 Mon Sep 17 00:00:00 2001 From: Dessa Simpson Date: Mon, 6 Jul 2020 22:02:19 -0700 Subject: [PATCH] Get client id and url prefix from config in main.eta --- src/app.ts | 12 ++++++++++-- views/main.eta | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app.ts b/src/app.ts index 4c24ac6..f223415 100644 --- a/src/app.ts +++ b/src/app.ts @@ -136,9 +136,17 @@ app.get("/", async (request, response) => { throw new Error ("Missing request.session") } if (!request.session.user) { - response.render('main.eta', { loggedIn: false }); + response.render('main.eta', { + loggedIn: false, + clientId: config.twitchClientId, + urlPrefix: config.urlPrefix + }); } else { - response.render('main.eta', { loggedIn: true, userName: request.session.user.display_name, userProfilePicture: request.session.user.profile_image_url }); + response.render('main.eta', { + loggedIn: true, + userName: request.session.user.display_name, + userProfilePicture: request.session.user.profile_image_url + }); } }); diff --git a/views/main.eta b/views/main.eta index 8982c43..e6ae26a 100644 --- a/views/main.eta +++ b/views/main.eta @@ -15,7 +15,7 @@ <%- } else { // Not logged in -%> - + <%- } %>