Hi,

I would like to get feedback from the community whether the following
is an expected behavior or bug.

Feedback appreciated. Thanks,
Kumar

Steps:
1) Got access token for docs.google.com to create spreadsheets.

var docToken = google.accounts.user.login('http://docs.google.com/
feeds/');

2) Got access token for spreadsheets.google.com to modify
spreadsheets.

var spToken = google.accounts.user.login('http://
spreadsheets.google.com/feeds/');

3) Remove the docToken created in step 1.

google.accounts.user.logout('http://docs.google.com/feeds/');

Expected result based of the documentation
http://code.google.com/apis/gdata/jsdoc/1.10/google/accounts/user.html#logout,
the user should be only logged out of the docs.google.com - i.e.
docToken removed.

However, what is happening is spToken is removed and docToken still
remains.



Sample Code:

<html>
    <head>
        <title>Test</title>
        <meta name="viewport" content="user-scalable=false">
         <script type="text/javascript" src="http://www.google.com/
jsapi"></script>
        <script>

             google.load('gdata', '1');
             google.setOnLoadCallback(toggleBtn);//do nothing.

             function toggleBtn() {

                 if (google.accounts.user.checkLogin('http://
docs.google.com/feeds/') == '') {

                     document.getElementById("dBtn").value = "Grant
Docs Access";
                     document.getElementById("dBtn").onclick = function
() {grantDocAccess();};

                 } else {

                     document.getElementById("dBtn").value = "Revoke
Docs Access";
                     document.getElementById("dBtn").onclick = function
() {revokeDocAccess();};

                 }

                 if (google.accounts.user.checkLogin('http://
spreadsheets.google.com/feeds/') == '') {

                      document.getElementById("sBtn").value = "Grant
Spreadsheet Access";
                      document.getElementById("sBtn").onclick =
function() {grantSpreadsheetAccess();};

                 } else {

                     document.getElementById("sBtn").value = "Revoke
Spreadsheet Access";
                     document.getElementById("sBtn").onclick = function
() {revokeSpreadsheetAccess();};

                 }
                 checkStatus();

             }

             function grantDocAccess() {

                var token = google.accounts.user.login('http://
docs.google.com/feeds/');

               toggleBtn();


             }

             function revokeDocAccess() {

                 var status = google.accounts.user.logout('http://
docs.google.com/feeds/');
                 toggleBtn();

             }

             function grantSpreadsheetAccess() {

                var token = google.accounts.user.login('http://
spreadsheets.google.com/feeds/');
                toggleBtn();

             }

             function revokeSpreadsheetAccess() {

                 var status = google.accounts.user.logout('http://
spreadsheets.google.com/feeds/');
                 toggleBtn();


             }

             function checkStatus() {

                 document.getElementById("doc_token").innerHTML =
'http://docs.google.com/feeds/' + ": " +
google.accounts.user.checkLogin('http://docs.google.com/feeds/');;
                 document.getElementById("sp_token").innerHTML =
'http://spreadsheets.google.com/feeds/' + ": " +
google.accounts.user.checkLogin('http://spreadsheets.google.com/
feeds/');;
             }
        </script>
    </head>
    <body>
        <input id="dBtn" type="button" value="Grant Docs Access"
onclick="grantDocAccess()"/><br>
        <input id="sBtn" type="button" value="Grant Spreadsheet
Access" onclick="grantSpreadsheetAccess()"/><br>
        <input type="button" value="Check token status"
onclick="checkStatus()"><br>

        <div id="doc_token"></div><br>
        <div id="sp_token"></div>

    </body>
</html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Docs Data APIs" group.
To post to this group, send email to Google-Docs-Data-APIs@googlegroups.com
To unsubscribe from this group, send email to 
google-docs-data-apis+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Docs-Data-APIs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to