Page MenuHomePhabricator

Requesting tokens when not authenticated
Closed, DeclinedPublic

Description

When requesting a token via action=tokens when not logged in

I get the response
{
"warnings": {

		"tokens": {
			"*": "Action 'import' is not allowed for the current user"
		}

},
"tokens": [

]
}

To be consistent with the rest of the api, this should return a json object with an error key so that it is clear that this is an error.


Version: unspecified
Severity: minor

Details

Reference
bz38715

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:03 AM
bzimport set Reference to bz38715.
bzimport added a subscriber: Unknown Object (MLST).

I guess the issue here is that if you request multiple tokens, 1 edit and 1 import you don't want the whole request to fail if your not allowed to import as you still want the edit token.

What Addshore said.

{

"warnings": {
    "tokens": {
        "*": "Action 'delete' is not allowed for the current user"
    }
},
"tokens": {
    "edittoken": "+\\"
}

}