Skip to main content
Version: 5.17.0

OnOtherDeviceLoginDetectedError

Description

If you log in to the same account from another device, the token on the original device expires, causing all requests to fail. At that time, the following error is returned, and the handler is called.\ The handler is called when the following error is returned:

When the refresh_token expired because the user logged in to another device\ statusCode : 401\ errorCode : BadUnauthorizedException\ message : bad refreshToken, Invalid refreshToken.

Precautions when setting notes on handler operation\

In addition to token expirations due to access from other devices,\ the token may also expire and cause the handler to operate when the user is restricted (blocked) through the console while logged in.\ Considering this situation, we recommend setting the UI note on handler operations for users in forms\ that can address various circumstances, such as 'Your login information has expired (due to duplicate login, restriction, etc.). Please restart the game.'\

For the handler to work, the BACKND Inspector window's Auto Refresh Token field must be enabled.

Example

void Start() {
if(Backend.IsInitialized) {
Backend.ErrorHandler.OnOtherDeviceLoginDetectedError = () => {
Debug.Log("External login detected!!!");
gameObject.GetComponentInChildren<Text>().text = "Login detected from another device.";
};
}
}