Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Preserve return URL for WebID-TLS.
  • Loading branch information
RubenVerborgh committed May 4, 2018
commit 3da620ea7dc704f56fadc8f5c82dccb7c0a6cf54
9 changes: 5 additions & 4 deletions default-views/auth/login-tls.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '/'
})
})
</script>
9 changes: 9 additions & 0 deletions default-views/auth/select-provider.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,14 @@
<button type="submit" class="btn btn-primary" id="discover">Submit</button>
</form>
</div>
<script>
// Temporary solution to preserve return URL
// until https://github.com/solid/oidc-auth-manager/issues/17 is resolved
const locationUrl = new URL(location)
const returnToUrl = locationUrl.searchParams.get('returnToUrl')
localStorage.removeItem('returnToUrl')
if (returnToUrl && new URL(returnToUrl).host === locationUrl.host)
localStorage.setItem('returnToUrl', returnToUrl)
</script>
</body>
</html>