socialNetworkLoginV2
Step 1 of the SSO V2 flow (social login with additional registration fields). Call it with the authorization code from the social network redirect. Unlike `socialNetworkLogin`, it never creates an account silently. If the social identity is already known, the session is logged in and `data` holds the usual login fields (`user_id`, `auth_token`, ...). If the identity is new, nothing is created: `data` holds a `registration` object with the profile data the social network returned and a short-lived registration token. Show your registration form pre-filled (and locked) with that data, let the player complete the remaining required fields, and submit them with the token to `registerUserBySocialInfo`. The token expires 10 minutes after this response, and the authorization code is single-use, so after expiry the player has to restart the social login. Works on a plain session; no prior login is required.
Documentation
Try it now
Request parameters:
Call example:
socialNetworkLoginV2({
code: '4/0AVGzR1DkX...',
socialNetworkTypeId: 'google',
redirectUrl: 'https://www.example.com/social-callback'
})Response examples:
{
errorKey: '',
hasError: false,
errorMessage: '',
data: {
registration: {
token: '3b7d0f4a9c2e4f8b8a6d1c5e7f9a2b4c',
expires_at: 1789552800,
social_network_type: 1,
email: '[email protected]',
first_name: 'John',
last_name: 'Doe'
}
}
}