1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 17:28:51 +02:00
phorge-phorge/webroot/rsrc/externals/javelin/lib
epriestley e869e7df0b When logged-out users hit a "Login Required" dialog, try to choose a better "next" URI
Summary:
Ref T10004. After a user logs in, we send them to the "next" URI cookie if there is one, but currently don't always do a very good job of selecting a "next" URI, especially if they tried to do something with a dialog before being asked to log in.

In particular, if a logged-out user clicks an action like "Edit Blocking Tasks" on a Maniphest task, the default behavior is to send them to the standalone page for that dialog after they log in. This can be pretty confusing.

See T2691 and D6416 for earlier efforts here. At that time, we added a mechanism to //manually// override the default behavior, and fixed the most common links. This worked, but I'd like to fix the //default// beahvior so we don't need to remember to `setObjectURI()` correctly all over the place.

ApplicationEditor has also introduced new cases which are more difficult to get right. While we could get them right by using the override and being careful about things, this also motivates fixing the default behavior.

Finally, we have better tools for fixing the default behavior now than we did in 2013.

Instead of using manual overrides, have JS include an "X-Phabricator-Via" header in Ajax requests. This is basically like a referrer header, and will contain the page the user's browser is on.

In essentially every case, this should be a very good place (and often the best place) to send them after login. For all pages currently using `setObjectURI()`, it should produce the same behavior by default.

I'll remove the `setObjectURI()` mechanism in the next diff.

Test Plan: Clicked various workflow actions while logged out, saw "next" get set to a reasonable value, was redirected to a sensible, non-confusing page after login (the page with whatever button I clicked on it).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10004

Differential Revision: https://secure.phabricator.com/D14804
2015-12-17 08:30:03 -08:00
..
__tests__ Remove an unused variable 2015-01-20 21:25:40 +11:00
control Have "limit=1" tokenizers replace tokens instead of disabling "Browse" 2015-12-14 15:29:42 -08:00
behavior.js Remove @group annotations 2014-07-10 08:12:48 +10:00
Cookie.js Fix another undefined variable 2015-01-20 08:55:04 +11:00
DOM.js Don't copy null attributes passed to JX.$N() 2015-08-31 15:52:04 -07:00
History.js Fix an issue with returning to a the initial page in Quicksand 2015-03-28 07:38:14 -07:00
JSON.js Remove @group annotations 2014-07-10 08:12:48 +10:00
Leader.js Fix an undefined variable 2015-01-23 07:22:39 +11:00
Mask.js Remove @group annotations 2014-07-10 08:12:48 +10:00
Quicksand.js When logged-out users hit a "Login Required" dialog, try to choose a better "next" URI 2015-12-17 08:30:03 -08:00
Request.js Fix various lint issues in rJX 2015-01-14 07:59:56 +11:00
Resource.js Fix various lint issues in rJX 2015-01-14 07:59:56 +11:00
Routable.js Provide a global router for Ajax requests 2014-05-05 10:57:42 -07:00
Router.js Provide a global router for Ajax requests 2014-05-05 10:57:42 -07:00
Scrollbar.js Stop using JX.Scrollbar for main page content 2015-05-11 12:02:00 -07:00
Sound.js Add support for playing sounds 2015-03-10 14:20:00 -07:00
URI.js When logged-out users hit a "Login Required" dialog, try to choose a better "next" URI 2015-12-17 08:30:03 -08:00
Vector.js Fix anchor-clicking scroll positions 2015-01-28 08:26:10 -08:00
WebSocket.js Namespace Aphlict clients by request path, plus other fixes 2015-02-16 11:31:15 -08:00
Workflow.js Improve Conpherence column textarea JS behaviors 2015-03-14 12:00:17 -07:00