A saved query can have tokens that require a valid current viewer. For example, this token:
viewer()
Before this change, visiting such saved queries would cause this:
This datasource ("PhabricatorPeopleUserFunctionDatasource") can not evaluate the function "viewer(...)".
After this change, instead of that, you are just redirected to the login page,
so, after you do the login, you are redirected back to that saved query and it works.
This fix was boosted during the Wikimedia Hackaton (wmhack) in Tallinn. Thanks Tallinn!
https://phabricator.wikimedia.org/T356384
Fixes T15704