Socialid.login.logout
(Difference between revisions)
Renato.neves (Talk | contribs) (→API Response) |
Ivan.filho (Talk | contribs) |
||
Line 2: | Line 2: | ||
API to logout the user (destroy the current login session). | API to logout the user (destroy the current login session). | ||
+ | |||
+ | In case of success this API will also trigger the removal of the stored Connection ID, based on '''connectionStorageType''' option: | ||
+ | |||
+ | {| | ||
+ | ! align="left" width="200px" | none | ||
+ | | The Connection ID Cookie is not stored. | ||
+ | |+ | ||
+ | ! align="left" width="200px" | cookie | ||
+ | | The Connection ID Cookie will be destroyed. | ||
+ | |+ | ||
+ | ! align="left" width="200px" | localStorage | ||
+ | | The Connection ID Local Storage item will be removed. | ||
+ | |+ | ||
+ | ! align="left" width="200px" | sessionStorage | ||
+ | | The Connection ID Session Storage item will be removed. | ||
+ | |} | ||
+ | |||
== Usage == | == Usage == |
Revision as of 14:00, 5 November 2020
Contents |
Description
API to logout the user (destroy the current login session).
In case of success this API will also trigger the removal of the stored Connection ID, based on connectionStorageType option:
none | The Connection ID Cookie is not stored. | cookie | The Connection ID Cookie will be destroyed. | localStorage | The Connection ID Local Storage item will be removed. | sessionStorage | The Connection ID Session Storage item will be removed. |
---|
Usage
socialid.login.logout(handler)
Parameters
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 user has been logged out 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