PlayerState not updated inside ChoosePlayerStart function

I override PostLogin and get the PlayerState from APlayerController

void AProjectOrbGameMode::PostLogin(APlayerController* NewPlayer)
{
	Super::PostLogin(NewPlayer);

	// Initializing player values
	AOrbPlayerState* playerState = Cast<AOrbPlayerState>(NewPlayer->PlayerState);
	
	playerState->TeamID = 1;
	UE_LOG(LogTemp, Log, TEXT("PostLogin"));
}

And in ChoosePlayerStart, I want to choose the player start based on TeamID. But when I tried to access the TeamID from PlayerStats in ChoosePlayerStart its 0.

AActor* AProjectOrbGameMode::ChoosePlayerStart_Implementation(AController* PlayerController)
{
	AOrbPlayerState* orbPlayerState = Cast<AOrbPlayerState>(PlayerController->PlayerState);

	int playerTeamID = orbPlayerState->TeamID;
	UE_LOG(LogTemp, Log, TEXT("Player TeamID: %d"), playerTeamID);

	// code regarding selection of player start
}

Is this because PostLogin and ChoosePlayerStart both happen in single frame and Replicated variables only update at the end of frame?

EDIT: ChoosePlayerStart runs before PostLogin which is why the values are default. How can I select the player start based on TeamID if the TeamID is initialized after selecting the player start?

I kind of got the flow and its solved. For anyone looking for same answer (as i saw two or three posts with same issue)

The order of execution

  1. ChoosePlayerStart
  2. FindPlayerStart
  3. Login
  4. FindPlayerStart
  5. PostLogin

Since ChoosePlayerStart is called before PostLogin the values are not yet assigned. I dont know why FindPlayerStart is called before and after Login twice. But I moved the code that assign player TeamID to Login instead of PostLogin.

During first execution of FindPlayerStart TeamID is invalid so it will return nullptr, then during Login TeamID is assigned and after that, FindPlayerStart will run logic to find player start and return it.