Socialid.events.onLoginSuccess
From Social ID Developers
Revision as of 13:52, 5 November 2020 by Ivan.filho (Talk | contribs)
Contents |
Description
Triggered when the user ends the login process successfully.
This event can also store the returned Connection ID, based on connectionStorageType option:
none | The Connection ID will not be stored | cookie | The Connection ID value will be stored in a Cookie. | localStorage | The Connection ID value will be saved as a Local Storage item. | sessionStorage | The Connection ID value will be saved as a Session Storage item. |
---|
Adding Handler
socialid.events.onLoginSuccess.addHandler(handler)
Event Data
event | onLoginSuccess | token | Token related to the user that just logged in. With this token and the secret from your Social Login application it's possible to get information about the user (e.g. his profile). It's advisable to get this information using a server-side script so you don't expose your application secret. | connection_id | User active connection id. | callback_url | Callback URL configured on the social login application. | provider | Provider used in the login process. Can be "facebook", "twitter", "linkedin", or "gplus". |
---|
Example
Adding a handler for the onLoginSuccess event on Social Login:
socialid.events.onLoginSuccess.addHandler(function(data) { console.log("Website received onLoginSuccess: ", data); });
Example response object:
{ event: "onLoginSuccess", token: "13d7555531d285adc34e21e7a9c583967c7a85507deee61fb6f1eeffc656409w", connection_id: "1234567890", callback_url: "https://sid-examples.herokuapp.com/social_logins", provider: "facebook" }