Skip to content

Commit

Permalink
feat: Set the IsAuthenticated property to true when player logs in or…
Browse files Browse the repository at this point in the history
… registers

This change ensures that players gain access to authenticated features once they successfully log in or complete the registration process.
  • Loading branch information
MrDave1999 committed Oct 3, 2024
1 parent 87b1f4a commit 95c8311
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Application/Players/Accounts/Systems/AccountSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ private void CreatePlayerAccount(
return;
}

connectedPlayer.AddComponent<AccountComponent>(playerInfo);
bool isAuthenticated = true;
connectedPlayer.GetComponent<AccountComponent>().Destroy();
connectedPlayer.AddComponent<AccountComponent>(playerInfo, isAuthenticated);
var message = Smart.Format(Messages.CreatePlayerAccount, new { Password = enteredPassword });
connectedPlayer.SendClientMessage(Color.Red, message);
playerInfo.SetName(connectedPlayer.Name);
Expand Down Expand Up @@ -100,7 +102,9 @@ private async void ShowLoginDialog(ConnectedPlayer connectedPlayer, PlayerInfo p
return;
}

connectedPlayer.AddComponent<AccountComponent>(playerInfo);
bool isAuthenticated = true;
connectedPlayer.GetComponent<AccountComponent>().Destroy();
connectedPlayer.AddComponent<AccountComponent>(playerInfo, isAuthenticated);
connectedPlayer.SendClientMessage(Color.Red, Messages.SuccessfulLogin);
}
}

0 comments on commit 95c8311

Please sign in to comment.