fix(signin): try to preserve current page across reauthentication (#7013)
If an authentication session expires or is lost for whatever reason, XO redirects to `/signin`. This redirect generally preserves the URL fragment (hash) which contains the page selected prior to reauthentication, i.e. if the user had been in settings/servers just beforehand, they end up at `/signin#settings/servers`. However, currently when they log back in they end up on the home page; the page they were on is forgotten. This commit tries to send the user back to the page they were viewing before reauthentication, by preserving the URL fragment in the login form action / by appending it to the links to authentication plugins. (Not all authentication plugins will necessarily preserve it internally, but we can optimistically try it and see; at worst the old behaviour will remain.)
This commit is contained in:
parent
8cdb5ee31b
commit
e3f57998f7
@ -69,3 +69,14 @@ html
|
||||
button.btn.btn-block.btn-info
|
||||
i.fa.fa-sign-in
|
||||
| Sign in
|
||||
script.
|
||||
(function () {
|
||||
var d = document
|
||||
var h = d.location.hash
|
||||
d.querySelectorAll('a').forEach(a => {
|
||||
a.href += h
|
||||
})
|
||||
d.querySelectorAll('form').forEach(form => {
|
||||
form.action += h
|
||||
})
|
||||
})()
|
||||
|
Loading…
Reference in New Issue
Block a user