diff --git a/default-views/auth/login-tls.hbs b/default-views/auth/login-tls.hbs index 77d99562f..07b11c683 100644 --- a/default-views/auth/login-tls.hbs +++ b/default-views/auth/login-tls.hbs @@ -30,10 +30,11 @@ return response }) .then(function(response) { - // TODO: redirect to proper location stored in hidden field redirect_uri - // depends on https://github.com/solid/node-solid-server/pull/648 - // and https://github.com/solid/oidc-auth-manager/issues/17 - window.location.href = '/' + // Temporary solution to restore return URL + // until https://github.com/solid/oidc-auth-manager/issues/17 is resolved + const returnToUrl = localStorage.getItem('returnToUrl') + localStorage.removeItem('returnToUrl') + window.location.href = returnToUrl || '/' }) }) diff --git a/default-views/auth/select-provider.hbs b/default-views/auth/select-provider.hbs index a158b3f14..17f28af60 100644 --- a/default-views/auth/select-provider.hbs +++ b/default-views/auth/select-provider.hbs @@ -20,15 +20,22 @@ {{/if}}
-
+
- - +
+ diff --git a/lib/handlers/error-pages.js b/lib/handlers/error-pages.js index ab8908672..ae45bb046 100644 --- a/lib/handlers/error-pages.js +++ b/lib/handlers/error-pages.js @@ -163,15 +163,12 @@ function redirectToSelectProvider (req, res) { res.status(401) res.header('Content-Type', 'text/html') - let currentUrl = util.fullUrlForReq(req) - req.session.returnToUrl = currentUrl - - let locals = req.app.locals - let loginUrl = locals.host.serverUri + - '/api/auth/select-provider?returnToUrl=' + currentUrl + const locals = req.app.locals + const currentUrl = util.fullUrlForReq(req) + const loginUrl = `${locals.host.serverUri}/api/auth/select-provider?returnToUrl=${encodeURIComponent(currentUrl)}` debug('Redirecting to Select Provider: ' + loginUrl) - let body = redirectBody(loginUrl) + const body = redirectBody(loginUrl) res.send(body) } @@ -188,13 +185,13 @@ function redirectBody (url) { return ` Redirecting... -If you are not redirected automatically, +If you are not redirected automatically, follow the link to login ` }