Socialid.events.onLoginError
From Social ID Developers
(Difference between revisions)
Renato.neves (Talk | contribs) (Created page with "== Description == Executado quando algum erro acontece durante o processo de login. == Adding Handler == socialid.events.onLoginError.addHandler(handler) == Event Data == ...") |
|||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
== Description == | == Description == | ||
− | + | Triggered when an error occurs during the login process. | |
== Adding Handler == | == Adding Handler == | ||
Line 14: | Line 14: | ||
|+ | |+ | ||
! align="left" width="200px" | provider | ! align="left" width="200px" | provider | ||
− | | | + | | Provider used in the login process. Can be "facebook", "twitter", "linkedin", or "gplus". |
|+ | |+ | ||
! align="left" width="200px" | code | ! align="left" width="200px" | code | ||
− | | | + | | The error code returned during the login process. |
|} | |} | ||
== Error codes == | == Error codes == | ||
− | + | {| | |
+ | ! align="left" width="200px" | unauthorized | ||
+ | | It wasn't possible to get the access token for the user because the login code expired or the application credentials are invalid. | ||
+ | |+ | ||
+ | ! align="left" width="200px" | request_timeout | ||
+ | | The social network took too long to return the access token. | ||
+ | |+ | ||
+ | ! align="left" width="200px" | service_unavailable | ||
+ | | The social network is not available right now. | ||
+ | |+ | ||
+ | ! align="left" width="200px" | blocked | ||
+ | | This Account is not receiving new logins because it hit the maximum number of contacts for its plan. | ||
+ | |+ | ||
+ | ! align="left" width="200px" | user_inactive | ||
+ | | The user is inactive. See: [[PUT login/users/:user_id/activate]] | ||
+ | |+ | ||
+ | ! align="left" width="200px" | internal_server_error | ||
+ | | An unknown error occurred. | ||
+ | |} | ||
== Example == | == Example == | ||
− | + | Adding a handler for the onLoginError event on Social Login: | |
socialid.events.onLoginError.addHandler(function(data) { | socialid.events.onLoginError.addHandler(function(data) { | ||
Line 32: | Line 50: | ||
}); | }); | ||
− | + | Example response object: | |
{ | { |
Latest revision as of 16:35, 30 December 2021
Contents |
Description
Triggered when an error occurs during the login process.
Adding Handler
socialid.events.onLoginError.addHandler(handler)
Event Data
event | onLoginError | provider | Provider used in the login process. Can be "facebook", "twitter", "linkedin", or "gplus". | code | The error code returned during the login process. |
---|
Error codes
unauthorized | It wasn't possible to get the access token for the user because the login code expired or the application credentials are invalid. | request_timeout | The social network took too long to return the access token. | service_unavailable | The social network is not available right now. | blocked | This Account is not receiving new logins because it hit the maximum number of contacts for its plan. | user_inactive | The user is inactive. See: PUT login/users/:user_id/activate | internal_server_error | An unknown error occurred. |
---|
Example
Adding a handler for the onLoginError event on Social Login:
socialid.events.onLoginError.addHandler(function(data) { console.log("Website received onLoginError: ", data); });
Example response object:
{ event: "onLoginError", provider: "twitter", code: "request_timeout" }