- Code: Select all
https://www.nationstates.net/asnation=racoda/nation=racoda
Upon clicking that link, we're either presented with the nation's page (if logged in) or asked to log in to that nation.
My understanding is that asnation checks if a user is logged in with the nation specified. So, for example asnation=racoda checks if Racoda is logged in.
However, trouble arises if the URL includes both asnation and nation with different parameters.
In the following examples, it is assumed I'm logged in as Racoda:
- https://www.nationstates.net/asnation=racoda/nation=racoda_in_tep
correctly checks if I'm logged in as Racoda and proceeds to display the nation page of Racoda in TEP. - https://www.nationstates.net/asnation=racoda_in_tep/nation=racoda
correctly checks if I'm logged in as Racoda in TEP. Because I'm not, it prompts me to log in. However, it (incorrectly) presents a form with the "Nation" field set to racoda instead of racoda_in_tep.
If I re-login with Racoda, I am redirected to https://www.nationstates.net/page=display_nation/asnation=racoda_in_tep, but I'm presented with a login form.
If I login with Racoda in TEP, I am redirected to the same URL (https://www.nationstates.net/page=display_nation/asnation=racoda_in_tep), and presented with the Racoda in TEP's nation page.
Additionally, in both cases, I think it should redirect to https://www.nationstates.net/page=display_nation/nation=racoda instead.
I'd like to add that this issue was initially discovered when trying to use an URL of this format: https://www.nationstates.net/page=deck/nation=puppet_1/asnation=puppet_2. The behaviour is consistent with the presented examples, so it's not an issue of page=display_nation not being present.
I realize that asnation probably isn't used outside of those emails, but it is an interesting functionality that could be used by tools trying to integrate with NationStates (and requiring that the user be logged in with the nation specified).
Regardless, the bug/inconsistency here is that: the logged-in check is done against the value of asnation but the UI's default value is replaced with the value of the nation parameter when the asnation check fails; and that the URL is incorrectly redirected, with nation being dropped from it instead of asnation.