From 63fdf150e1ed81e3b1059050f7b1ba323931ab24 Mon Sep 17 00:00:00 2001 From: Alex Anderson <191496+alxndrsn@users.noreply.github.com> Date: Tue, 26 Sep 2023 00:58:25 +0300 Subject: [PATCH] oidc: show unbranded spinner on forwarding page (#981) Spinner source: https://loading.io/css/ Licence: CC0 (public domain) Co-authored-by: alxndrsn --- lib/http/endpoint.js | 6 +++++- lib/resources/oidc.js | 48 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 46 insertions(+), 8 deletions(-) diff --git a/lib/http/endpoint.js b/lib/http/endpoint.js index c524bbedd..f345e7425 100644 --- a/lib/http/endpoint.js +++ b/lib/http/endpoint.js @@ -241,7 +241,11 @@ const defaultEndpoint = endpointBase({ const htmlEndpoint = endpointBase({ resultWriter: (result, request, response) => { response.type('text/html'); - response.send(frontendPage(result)); + if (typeof result === 'string') { + response.send(result); + } else { + response.send(frontendPage(result)); + } }, errorWriter: (error, request, response) => { response.type('text/html'); diff --git a/lib/resources/oidc.js b/lib/resources/oidc.js index 677256351..85a5bad2c 100644 --- a/lib/resources/oidc.js +++ b/lib/resources/oidc.js @@ -118,13 +118,47 @@ module.exports = (service, endpoint) => { // Instead, we need to render a page and then "browse" from that page to the normal frontend: // id=cl only set for playwright. Why can't it locate this anchor in any other way? - return { - head: html``, - body: html` -

Authentication Successful

-
Continue to ODK Central
- `, - }; + return html` + + + + Loading... | ODK Central + + + + +
+
+ +
+ + + `; } catch (err) { if (redirect.isRedirect(err)) { throw err;