Skip to main content
Version: 6.0.0

IsBadAccessTokenError

public bool IsBadAccessTokenError();

Description

When a Bad AccessToken error occurs because 24 hours have passed after login or an attempt is made to log in via another device, 'true' is returned.
When 24 hours have passed since login, you can call Backnd.Player.ReSignIn to resolve the issue.

When logging in from another device, the access token must be reissued by logging in manually, which can be done through custom login or federation sign-in.

The included error cases are as follows:

  • When the user's Access Token is wrong or expired
    statusCode : 401
    errorCode : BadUnauthorizedException

  • When the user's Access Token is wrong or expired upon logging in
    statusCode : 401
    errorCode : BadUnauthorizedException

Example

BackndReturnObject bro = Backnd.PlayerTable.Get("tableName");

if(bro.IsSuccess())
{

}
else
{
if(bro.IsBadAccessTokenError())
{
Debug.Log("When the access token is expired");

var bro2 = Backnd.Player.ReSignIn();
if(bro2.GetMessage() == "bad refreshToken")
{
Debug.Log("Logged in from another device.");
}
}
}