Register new user w...
 
Notifications
Clear all

Register new user while logged in

3 Posts
2 Users
0 Reactions
683 Views
(@braddon85)
Posts: 5
Active Member
Topic starter
 

Is it possible to register a new account if there is already a local user authenticated?

Your code;

User newUser = new User();

newUser.userName = "username";

newUser.password = "password";

newUser.Update( (bool success, string error) => {

// NB: registration does not make the user logged

if (success)

Debug.Log("Save success: ID " + newUser.id);

else

Debug.Log("Save failed: " + error);

});

Works when there is no local user. But when I’m logged in, I’d like to create a new, different user for future purposes but I don’t want to logout or authenticate as this new user. Just have it created on the combu database.

Is this possible? The newUser.Update() fails if I’m already logged in.

 
Posted : 03/08/2016 4:25 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

May be we disabled this in the last versions for some issues, we can try to re-enable it again in the following weeks when coming back from summer holidays in the next 2 weeks. We will eventually get back here when it'll be done.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 12/08/2016 5:52 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

I tried to create a new account while localUser was already authenticated and it worked without any issue, what is your code and the result of Update?

Here is the code I used for the test (make sure you have the latest version 2.1.9 of Combu):

CombuManager.platform.Authenticate ("aa", "aa", (bool success, string error) => {

   if (success) {

      User u = new User();
      u.userName = "bb";
      u.password = "bb";
      u.Update((bool arg1, string arg2) => {
         Debug.Log("created: " + arg1 + " - error: " + arg2);
      });

   }

});

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 23/08/2016 4:42 pm
Share: