Create a New White Label User
Last updated
Last updated
Before we can register a session in the game, a user must first be created.
Passwords must be at least 8 characters long.
// Remember to use the LootLocker namespace in the top of your file.
using LootLocker.Requests;
// This code should be placed in a handler when user clicks the sign up button.
string email = "user@lootlocker.io";
string password = "password here";
LootLockerSDKManager.WhiteLabelSignUp(email, password, (response) =>
{
if (!response.success)
{
Debug.Log("error while creating user");
return;
}
Debug.Log("user created successfully");
});
This requires that you have set up the Unreal SDK in your game.
Above is an example of how to implement White Label account creation using blueprints in Unreal Engine. For an example you can copy and paste into your editor, look here.
Input
You need to exchange the TriggerWhiteLabelCreateAccount
event for whatever event you want to use to trigger the login flow.
Remove the nodes Replace: Input
with the email and password input from the user input in your game.
Output
We recommend branching the completed events on the success flag, and if you do this you will probably want to add error handling in case the request fails as well as what (if any) continued actions you want on success.
var response = await LL_WhiteLabel.SignUp.new("input-user-email-here", "input-user-password-here").send()
if(!response.success) :
# Request failed, handle errors
pass
else:
# Request succeeded, use response as applicable in your game logic
# Remember to remind the player to verify their email to be able to utilize this new account
pass
curl -X POST "https://api.lootlocker.io/white-label-login/sign-up" \
-H "domain-key: 11aaa11" \
-H "is-development: true" \
-H "Content-Type: application/json" \
-d "{\"email\": \"test@lootlocker.io\", \"password\": \"some password here\"}"
Example response:
{
"id": 406,
"game_id": 2,
"email": "test@lootlocker.io",
"created_at": "2021-08-25T08:03:34.612346459Z",
"updated_at": "2021-08-25T08:03:34.612346459Z",
"deleted_at": null,
"validated_at": null
}