EOS: how to refresh access token? After I login, it only works for 2 hours, then the game freezes

void UECROnlineSubsystem::Login(FString PlayerName, FString LoginType, FString Id, FString Token, bool bWantsCallback)
{
	// Setting player display name
	UserDisplayName = PlayerName;

	// Login
	if (OnlineSubsystem)
	{
		if (const IOnlineIdentityPtr OnlineIdentityPtr = OnlineSubsystem->GetIdentityInterface())
		{
			FOnlineAccountCredentials OnlineAccountCredentials;
			OnlineAccountCredentials.Id = Id;
			OnlineAccountCredentials.Token = Token;
			OnlineAccountCredentials.Type = LoginType;

			if (bWantsCallback)
			{
				OnlineIdentityPtr->OnLoginCompleteDelegates->AddUObject(this, &UECROnlineSubsystem::OnLoginComplete);
			}
			OnlineIdentityPtr->Login(0, OnlineAccountCredentials);
		}
	}
}

Then I usually login via accountportal

Login(PlayerName, "accountportal");

But in logs I see that access token works only for 2 hours. After that the game usually freezes.

LogEOSAuth: NewUserToken: User ClientId: ... AccountId: .... Access[Expires: 2023.05.10-20.41.16 Remaining: 7200.71] Refresh[Expires: 2023-11-06T18:41:16.715Z Remaining: 15552000.71] State: Valid

[2023.05.10-19.40.15:439][120]LogOnline: Error: EOS: ConnectLoginNoEAS(0) failed due to no platform OSS [2023.05.10-19.40.15:439][120]LogOnline: Error: EOS: ConnectLoginNoEAS(0) failed due to the platform OSS giving an empty auth token

How can I use the refresh token to update the access token with the OnlineSubsystem? Or maybe it should be done automatically then why it doesn’t happen?

Config is

[/Script/OnlineSubsystemEOS.EOSSettings]
CacheDir = CacheDir
DefaultArtifactName = DefaultArtifact
TickBudgetInMilliseconds = 0
bEnableOverlay = False
bEnableSocialOverlay = False
bShouldEnforceBeingLaunchedByEGS = False
TitleStorageReadChunkLength = 0
+Artifacts = (ArtifactName="DefaultArtifact",ClientId="...",ClientSecret="....",ProductId="....",SandboxId="...",DeploymentId="....",EncryptionKey="...")
bUseEAS = False
bUseEOSConnect = False
bMirrorStatsToEOS = False
bMirrorAchievementsToEOS = False
bUseEOSSessions = False
bMirrorPresenceToEAS = False

[OnlineSubsystemEOS]
bEnabled=true

[OnlineSubsystem]
DefaultPlatformService=EOS

[/Script/Engine.GameEngine]
+NetDriverDefinitions = (DefName="GameNetDriver",DriverClassName="OnlineSubsystemEOS.NetDriverEOS",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[/Script/OnlineSubsystemEOS.NetDriverEOS]
bIsUsingP2PSockets=true

Need to change bUseEAS from False to True and add NativePlatformService=EOS to [OnlineSubsystem]

hey , wan’t to login my players using access token of epic games ,
i already can get the access token prom player after they login but i don’t know how to use it for login

note : (i can’t use the normal method because i am targeting android and when i trigger login in android they redirect me to the browser which cause the game to quit (for players with low end deivices ) so i wan’t make custom webview inside my gaame for login and getting the access token ) sorry for that long note =(