NATION

PASSWORD

[BUG?]Inconsistent/buggy behaviour of asnation URL parameter

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
Racoda
Technical Moderator
 
Posts: 579
Founded: Aug 12, 2014
Democratic Socialists

[BUG?]Inconsistent/buggy behaviour of asnation URL parameter

Postby Racoda » Fri Jul 10, 2020 2:58 pm

In an email warning that a nation is about to CTE, the nation name link included looks like this:
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.
Last edited by Racoda on Wed Sep 16, 2020 9:54 pm, edited 2 times in total.

Acting as a player unless accompagnied by mod action or reddish text
Any pronouns

User avatar
Racoda
Technical Moderator
 
Posts: 579
Founded: Aug 12, 2014
Democratic Socialists

Postby Racoda » Wed Sep 16, 2020 9:55 pm

*bump*

Acting as a player unless accompagnied by mod action or reddish text
Any pronouns


Return to Technical

Who is online

Users browsing this forum: Ankuran, Atlas Corporation Terra, Equestria-Atlantia, Escapania, Esfalsa, Midworld, New Angharad, Oldemburgos, Ovare, West Vin Dapongdommul

Advertisement

Remove ads