Releases: colyseus/colyseus-defold
Releases · colyseus/colyseus-defold
0.15.10
0.15.9
0.15.8
0.15.7
0.15.6
0.15.5
0.15.4
New Auth API (https://github.com/colyseus/colyseus/releases/tag/0.15.15)
Define callback for Auth state change:
client.auth:on_change(function (auth_data)
if auth_data.user ~= null then
-- logged in!
else
-- logged out!
end
end);
Methods:
client.auth:get_user_data()
client.auth:register_with_email_and_password()
client.auth:sign_in_with_email_and_password()
client.auth:sign_in_anonymously()
client.auth:send_password_reset_email()
client.auth:sign_out()
- (❌ OAuth not yet implemented)
client.auth:sign_in_with_provider()
Example
client.auth.sign_in_with_email_and_password("[email protected]", "123456", function(err, auth_data)
if err ~= nil then
-- err.status
-- err.message
else
print(auth_data.token) -- token
pprint(auth_data.user) -- user data
end
end)