Socialid.login.logout
(Difference between revisions)
Renato.neves (Talk | contribs) (Created page with "== Description == Chama a API para deslogar o usuário atualmente logado no Social Login. == Usage == socialid.login.logout(handler) == Parameters == {| ! align="left" ...") |
Renato.neves (Talk | contribs) |
||
Line 1: | Line 1: | ||
== Description == | == Description == | ||
− | + | API to logout the user (destroy the current login session). | |
== Usage == | == Usage == | ||
Line 12: | Line 12: | ||
! align="left" width="200px" | handler | ! align="left" width="200px" | handler | ||
| width="200px" | opcional | | width="200px" | opcional | ||
− | | | + | | Callback function to handle the API response. |
|} | |} | ||
Line 19: | Line 19: | ||
{| | {| | ||
! align="left" width="200px" | data | ! align="left" width="200px" | data | ||
− | | | + | | Always "null". This API does not return data. |
|+ | |+ | ||
! align="left" width="200px" | status | ! align="left" width="200px" | status | ||
− | | | + | | The API response status. It could be "success", if logout the user successfully, or "not_found", if there is no user logged in the current login session. |
|} | |} | ||
== Example == | == Example == | ||
− | + | Logout the user from the current login session: | |
socialid.login.init(1); | socialid.login.init(1); | ||
var handler = function(response) { | var handler = function(response) { | ||
if (response.status == "success") { | if (response.status == "success") { | ||
− | alert(" | + | alert("You have been logged out successfully!"); |
} else { | } else { | ||
− | alert(" | + | alert("Could not log out."); |
} | } | ||
} | } | ||
socialid.login.logout(handler); | socialid.login.logout(handler); | ||
− | + | You can test this parameters in our playground: https://sid-examples.herokuapp.com/social_logins/playground |
Revision as of 18:03, 3 November 2014
Contents |
Description
API to logout the user (destroy the current login session).
Usage
socialid.login.logout(handler)
Parameters
handler | opcional | Callback function to handle the API response. |
---|
API Response
data | Always "null". This API does not return data. | status | The API response status. It could be "success", if logout the user successfully, or "not_found", if there is no user logged in the current login session. |
---|
Example
Logout the user from the current login session:
socialid.login.init(1); var handler = function(response) { if (response.status == "success") { alert("You have been logged out successfully!"); } else { alert("Could not log out."); } } socialid.login.logout(handler);
You can test this parameters in our playground: https://sid-examples.herokuapp.com/social_logins/playground