GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Send full returnToUrl to oidc-auth-manager by RubenVerborgh · Pull Request #648 · nodeSolidServer/node-solid-server Conversation
|
| </div> | ||
| <div class="container"> | ||
| <form method="post" action="/api/auth/select-provider"> | ||
| <form method="post"> |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Always POST to self, so we don't lose query string.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| <label for="webid">WebID or server URL:</label> | ||
| <input type="text" class="form-control" name="webid" id="webid" | ||
| value="{{serverUri}}" /> | ||
| <input type="hidden" name="returnToUrl" id="returnToUrl" value="" /> |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This one was always empty, so rather pointless. Instead, the query string should be used.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| '/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)}` |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Escaping was definitely important here (for query strings and such).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| <meta charset="UTF-8"> | ||
| <script> | ||
| window.location.href = "${url}" + window.location.hash | ||
| window.location.href = "${url}" + encodeURIComponent(window.location.hash) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
So it is the client who appends the hash (and only the client can do that).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| res.header('Content-Type', 'text/html') | ||
|
|
||
| let currentUrl = util.fullUrlForReq(req) | ||
| req.session.returnToUrl = currentUrl |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We can't rely on session, because the server cannot see the hash.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This fixed mechanism (not relying on session) will still work on direct requests by the browser (like, requesting an image or a pdf file or whatever), not mediated by a client?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If we end up in this code, we are in the process of rendering an HTML error page. So if that's the behavior we exhibit in response to a browser directly requesting an image (I hope not), it's broken for another reason already 😄
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ahh, I see. Makes sense.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
👍
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Addresses the node-solid-server part of #571.
8e3c6d0 to
299f5d6
Compare
b349038 to
e7be5dd
Compare
|
@timbl e7be5dd adds a temporary solution to preserve the full return URL (with hash) when logging in with WebID-TLS. Could you test |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
e7be5dd to
3da620e
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Works for me on timbl.com
Looks reasonable
An important fix!!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.