question

Sebastian Grabowski avatar image
Sebastian Grabowski asked

Login / Create user account in CloudScript (InternalServerError),Create/Login to user account by Cloud Script

I have tried to create user in Cloud Script but getting InternalServerError....

"apiError": {
                        "code": 500,
                        "status": "InternalServerError",
                        "error": "InternalServerError",
                        "errorCode": 1110,
                        "errorMessage": "An unexpected error occured while processing the request.",
                        "errorHash": "3ee2d5d04af68509f609456bd0bd66ff",

this is my code:

var accRequest = { CustomId: testCustomAccountID, CreateAccount: true, InfoRequestParameters: { GetPlayerProfile: true } }; 
var createAccoutResult = server.LoginWithServerCustomId(accRequest);

Is something wrong with the request?

,
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

The field name of the request for the LoginWithServerCustomId should be “ServerCustomId”, not be “CustomId”. You can follow the following code to modify the field name to fix the error.

handlers.loginWithServerCustomID = function (args, context) {
    var loginWithServerCustomIdRequest = {
        ServerCustomId: "[YourServerCustomId]",
        CreateAccount: true
    }
    var loginResult = server.LoginWithServerCustomId(loginWithServerCustomIdRequest);
    return loginResult;
}
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.