Socialid.login.disconnect
(Difference between revisions)
Dirceu.tiegs (Talk | contribs) m |
Renato.neves (Talk | contribs) |
||
Line 1: | Line 1: | ||
== Description == | == Description == | ||
− | + | API to disconnect a provider from the current login session. | |
== Usage == | == Usage == | ||
Line 11: | Line 11: | ||
{| | {| | ||
! align="left" width="200px" | provider | ! align="left" width="200px" | provider | ||
− | | width="200px" | | + | | width="200px" | required |
− | | | + | | Determines which provider will be disconnected from the user logged in the current login session. It could be "facebook", "twitter", "linkedin" or "gplus". |
|+ | |+ | ||
! align="left" width="200px" | handler | ! align="left" width="200px" | handler | ||
− | | width="200px" | | + | | width="200px" | optional |
− | | | + | | Callback function to handle the API response. |
|} | |} | ||
Line 23: | Line 23: | ||
{| | {| | ||
! 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 the provider was disconnected successfully, or "not_found", if there is no user logged in the current login session. |
|} | |} | ||
== Example == | == Example == | ||
− | + | Disconnects (removes) the Twitter credential from the user logged in 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("Your Twitter credentials was successfully removed!"); |
} else { | } else { | ||
− | alert(" | + | alert("It was not possible to remove your Twitter credential"); |
} | } | ||
} | } | ||
socialid.login.disconnect("twitter", handler); | socialid.login.disconnect("twitter", handler); | ||
− | + | You can test this parameters in our playground: https://sid-examples.herokuapp.com/social_logins/playground |
Revision as of 17:58, 3 November 2014
Contents |
Description
API to disconnect a provider from the current login session.
Usage
socialid.login.disconnect(provider, handler)
Parameters
provider | required | Determines which provider will be disconnected from the user logged in the current login session. It could be "facebook", "twitter", "linkedin" or "gplus". | handler | optional | 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 the provider was disconnected successfully, or "not_found", if there is no user logged in the current login session. |
---|
Example
Disconnects (removes) the Twitter credential from the user logged in the current login session:
socialid.login.init(1); var handler = function(response) { if (response.status == "success") { alert("Your Twitter credentials was successfully removed!"); } else { alert("It was not possible to remove your Twitter credential"); } } socialid.login.disconnect("twitter", handler);
You can test this parameters in our playground: https://sid-examples.herokuapp.com/social_logins/playground