question

brendan avatar image
brendan asked

Is there a logout request in the API ?

johntube
started a topic on Sat, 10 January 2015 at 3:26 PM

I'm using the PlayFabData.LoggedIn event in the Unity SDK to be notified of a successful login but I can't manually check if the user is logged in or not and I can't find a logout request in the API. A PlayFabData.LoggedOut event could also be useful.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Best Answer
Brendan Vanous said on Mon, 12 January 2015 at 1:19 AM

Because the PlayFab services were created as Web API calls to start, a "logout" function didn't really make sense. The majority case for titles in this space is that they connect the user to a session and send data on it, updating the session token when needed. That said, the concept of an explicit "logout" is on our backlog. If we find that this is a priority to our development community, we will definitely look at prioritizing the work to enable an API call for it.


3 Comments
Brendan Vanous said on Mon, 12 January 2015 at 1:19 AM

Because the PlayFab services were created as Web API calls to start, a "logout" function didn't really make sense. The majority case for titles in this space is that they connect the user to a session and send data on it, updating the session token when needed. That said, the concept of an explicit "logout" is on our backlog. If we find that this is a priority to our development community, we will definitely look at prioritizing the work to enable an API call for it.


johntube said on Tue, 13 January 2015 at 5:00 PM

In the Unity SDK there is some kind of workaround : set PlayFabData.SkipLogin to false and PlayFabData.AuthKey to null.

So we can add this check : isLoggedIn = PlayFabData.AuthKey != null;

Maybe this should be added to the SDK.


Brendan Vanous said on Tue, 13 January 2015 at 5:45 PM

A fair point - back to your original question, yes, the AuthKey being non-NULL is indeed the indicator for whether the user is signed in. Thanks - we'll look at adding that to the SDK, to make it clearer.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.