Closed endel closed 7 months ago
Overview for Auth API:
client.Auth.OnChange((Colyseus.AuthData<User> authData) => { if (authData.user != null) { // Logged in! } else { // Logged out! } });
client.Auth.RegisterWithEmailAndPassword()
client.Auth.SignInWithEmailAndPassword()
client.Auth.SignInAnonymously()
client.Auth.SendResetPasswordEmail()
client.Auth.SignOut()
client.Auth.SignInWithProvider()
class User { public int id; public string email; public string name; } // ... try { var response = await client.Auth.SignInWithEmailAndPassword<User>("endel@colyseus.io", "123456"); Debug.Log(response.user.id); Debug.Log(response.user.email); Debug.Log(response.user.name); } catch (Colyseus.HttpException e) { // e.Message // e.StatusCode }
Can you provide a complete example of Auth?
Overview for Auth API:
Define callback for Auth state change:
Methods:
client.Auth.RegisterWithEmailAndPassword()
client.Auth.SignInWithEmailAndPassword()
client.Auth.SignInAnonymously()
client.Auth.SendResetPasswordEmail()
client.Auth.SignOut()
client.Auth.SignInWithProvider()
Example