From 13406e76de045117afad9beae1d203b953b44f3d Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 12 Apr 2021 10:05:44 +0100 Subject: [PATCH] Ensure theme login image is passed through to api response Fixes #2929 --- .../node_modules/@node-red/editor-api/lib/auth/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/node_modules/@node-red/editor-api/lib/auth/index.js b/packages/node_modules/@node-red/editor-api/lib/auth/index.js index d4ec10f08..fb95ede7b 100644 --- a/packages/node_modules/@node-red/editor-api/lib/auth/index.js +++ b/packages/node_modules/@node-red/editor-api/lib/auth/index.js @@ -90,7 +90,7 @@ function getToken(req,res,next) { return server.token()(req,res,next); } -function login(req,res) { +async function login(req,res) { var response = {}; if (settings.adminAuth) { var mergedAdminAuth = Object.assign({}, settings.adminAuth, settings.adminAuth.module); @@ -116,8 +116,9 @@ function login(req,res) { response.prompts[0].image = theme.serveFile('/login/',mergedAdminAuth.strategy.image); } } - if (theme.context().login && theme.context().login.image) { - response.image = theme.context().login.image; + let themeContext = await theme.context(); + if (themeContext.login && themeContext.login.image) { + response.image = themeContext.login.image; } } res.json(response);