Socialid.login.disconnect

From Social ID Developers
(Difference between revisions)
Jump to: navigation, search
m
(Parameters)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Description ==
 
== Description ==
  
Chama a API para desconectar um determinado provedor do usuário atualmente logado no Social Login.
+
API to disconnect (remove) a provider from the user logged in the current login session. This API can trigger the following events:
 +
* [[socialid.events.onDisconnectSuccess]]
 +
* [[socialid.events.onDisconnectError]]
  
 
== Usage ==
 
== Usage ==
Line 11: Line 13:
 
{|
 
{|
 
! align="left" width="200px" | provider
 
! align="left" width="200px" | provider
| width="200px" | obrigatório
+
| width="200px" | required
| Especifica o provedor que se deseja desconectar do usuário logado atualmente. Pode ser "facebook", "twitter", "linkedin" ou "gplus".  
+
| Determines which provider will be disconnected from the user logged in the current login session. Can be "facebook", "twitter", "linkedin", "gplus", "instagram" or "apple".  
 
|+
 
|+
 
! align="left" width="200px" | handler
 
! align="left" width="200px" | handler
| width="200px" | opcional
+
| width="200px" | optional
| Especifica uma função de callback para tratar a resposta da API.
+
| Callback function to handle the API response.
 
|}
 
|}
  
Line 23: Line 25:
 
{|
 
{|
 
! align="left" width="200px" | data
 
! align="left" width="200px" | data
| Sempre "null". Esta API não retorna dados.
+
| Always "null". This API does not return data.
 
|+
 
|+
 
! align="left" width="200px" | status
 
! align="left" width="200px" | status
| O status da execução da chamada da API. Pode ser "success", se a desconexão foi realizada com sucesso, ou "not_found", caso não exista um usuário logado na sessão atual.
+
| The API response status. Can be '''success''', if the provider was disconnected successfully, or '''not_found''', if there is no user logged in the current login session.
 
|}
 
|}
  
 
== Example ==
 
== Example ==
  
Desconecta o provedor de Twitter do usuário logado atualmente (o usuário não terá mais a sua credencial do Twitter associada a sua conta de login):
+
Disconnects 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("Sua credencial do Twitter foi removida com sucesso!");
+
         alert("Your Twitter credential was successfully removed!");
 
     } else {
 
     } else {
         alert("Não foi possível remover sua conta do Twitter");
+
         alert("It was not possible to remove your Twitter credential");
 
     }
 
     }
 
   }
 
   }
 
   socialid.login.disconnect("twitter", handler);
 
   socialid.login.disconnect("twitter", handler);
  
Teste as APIs em nosso playground: https://sid-examples.herokuapp.com/social_logins/playground
+
You can test this parameters in our playground: https://sid-examples.herokuapp.com/social_logins/playground

Latest revision as of 20:42, 26 February 2020

Contents

Description

API to disconnect (remove) a provider from the user logged in the current login session. This API can trigger the following events:

Usage

 socialid.login.disconnect(provider, handler)

Parameters

provider required Determines which provider will be disconnected from the user logged in the current login session. Can be "facebook", "twitter", "linkedin", "gplus", "instagram" or "apple".
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. Can be success, if the provider was disconnected successfully, or not_found, if there is no user logged in the current login session.

Example

Disconnects 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 credential 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

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox