Yes @jobara, this is another responsibility that "invaded" the PMT while it shouldn't. Currently, GPII actually generates the token, but PMT is the one that holds it and passes it around. This should be resolved in the context of http://issues.gpii.net/browse/GPII-290 for which Kasper has made some progress. I tried to merge with @kaspermarkus's GPII-290 branch and indeed the functionality for reporting user's token is implemented. The problem with that branch is that it seems to be missing some CORS configuration on GPII side, so we cannot test the PMT tool with it until it gets merged in "master" with everything else. As for what we have now, the situation is quite far from ideal; yes, PMT will create and login a new user even if one is already logged in. Also, refreshing the page causes the whole state to be lost, so saving will generate a new token again and log it in, even if one has already be created. What we can do now:
1) Freeze this pull request until GPII-290 gets in
2) Let this in, assuming that PMT will not need to know of currently logged user and that we will not refresh any page. Then, create another "blocker" JIRA to make use of GPII-290, if and when available. What do you think?