Skip to main content
Version: 5.15.0

OnOtherDeviceLoginDetectedError

Description

This handler is called automatically when you use a currently connected account to log in with another device.
The handler is called when the following error is returned:

When the refresh_token expires 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 be 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.";
};
}
}