0

I tried logging out on my App using Android. I used the function logOut of the class CloudUser, but I ended up getting a Bad Request Response.

This is how I call the logOut-Method

CloudUserHelper.logOut(MainFreeDaysListActivity.this, CloudUser.getcurrentUser());

and this is the logOut-Method.

public static void logOut(final MainFreeDaysListActivity activity,final CloudUser user){
    new Thread(new Runnable()
    {
        @Override
        public void run()
        {
            try{
                user.logOut(new CloudUserCallback()
                {
                    @Override
                    public void done(CloudUser user, CloudException e) throws CloudException
                    {
                        if (e == null){
                            activity.backToWelcome();
                            activity.finish();
                        }
                        else{
                            e.printStackTrace();
                        }
                    }
                });
            }
            catch(CloudException e){
                System.out.println(e);
            }
        }
    }).start();
}

And finally, this is the error that I'm getting whenever I am trying to log out.

03-14 10:35:33.090 16000-17106/com.example.aetitia.freedays W/System.err: io.cloudboost.CloudException: {"message":"You are not logged in"}
03-14 10:35:33.091 16000-17106/com.example.aetitia.freedays W/System.err:     at io.cloudboost.CloudUser.logOut(CloudUser.java:264)
03-14 10:35:33.091 16000-17106/com.example.aetitia.freedays W/System.err:     at com.example.aetitia.freedays.CloudUserHelper$3.run(CloudUserHelper.java:104)
03-14 10:35:33.091 16000-17106/com.example.aetitia.freedays W/System.err:     at java.lang.Thread.run(Thread.java:818)

What could be the reason ?

Nawaz Dhandala
  • 2,046
  • 2
  • 17
  • 23
  • Hello! Please take the [tour] and try to understand the concept of a [MCVE]. That helps you since your question will be more likely to attract answers that way, and it helps us to understand your problem. – Seth Mar 14 '16 at 10:12
  • My Question is better like this? – Bob La Touffe Mar 14 '16 at 10:24
  • Yes, it is, good job :) I edited a bit, too. Should be good to go now. – Seth Mar 14 '16 at 10:41

1 Answers1

2

That error is a bug in CloudBoost JavaSDK-1.0.2 and the earlier builds of 1.0.3. Please clone the latest sources from github or get the latest release on maven.

Additionally, I have just created an android CloudUser demo, available on github which covers signup, login, logout plus the latest APIs: changePassword and resetPassword.

egimaben
  • 653
  • 7
  • 22