Hi all,

I'm working on a logout issue in the API Store mentioned in this jira[1].

This issue happens only when login out from the store after selecting an
api first. Normally when an api is selected following request is done by
adding api information as parameters.

https://localhost:9443/store/apis/info?name=app1&version=1&provider=admin

following is the request send when logout is clicked after selecting an api.
    https://localhost:9443/store/apis/info?

The reason for the error page is that the page is unable to load the api
information without the parameters.

The solution I was planning to do is like following

In pages/item-info.jag (where the request comes to), I store the last
viewed api info into the session. So when a logout request comes without
the parameters, I get them from the session and display the previously
viewed api. It would be something like this

//existing code assign name, version, provider from the request parameters

if(name != null && version != null && provider != null) {
    session.put("LastSelectedAppName" ,name);
    session.put("LastSelectedAppVersion" ,version);
    session.put("LastSelectedAppProvider" ,provider);
} else {
   //assign values when they are not in the request
    name = session.get("LastSelectedAppName");
    version = session.get("LastSelectedAppVersion");
    provider = session.get("LastSelectedAppProvider");
}

Any Comments on this approach?

[1] https://wso2.org/jira/browse/APIMANAGER-2828

Thanks,
Chamila.

-- 
Regards,
Chamila Adhikarinayake
Software Engineer
WSO2, Inc.
Mobile - +94712346437
Email  - [email protected]
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to