-
-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ProfileKeys fix #1069
ProfileKeys fix #1069
Conversation
📝 WalkthroughWalkthroughThe changes in this pull request involve modifications to the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java (2)
107-107
: LGTM! Consider adding a comment for clarity.The change from
Session.AccountType.MOJANG
toSession.AccountType.MSA
correctly aligns with the modern Minecraft authentication system and addresses the issue of incorrect ProfileKeys creation for alternate accounts. This update ensures that only Microsoft accounts (MSA) are treated as valid, potentially preventing ProfileKey creation for cracked accounts.Consider adding a brief comment explaining why MSA is used and how it relates to the ProfileKeys issue. For example:
// Use MSA account type to ensure ProfileKeys are only created for valid Microsoft accounts Session.AccountType.MSA);
Line range hint
1-624
: Overall, the change looks good and addresses the issue. Consider adding a safeguard.The modification from
MOJANG
toMSA
account type effectively addresses the issue of incorrect ProfileKeys creation for alternate accounts. This change aligns well with the PR objectives and the modern Minecraft authentication system.To enhance robustness, consider adding a check to ensure that only Microsoft accounts are processed. This could prevent any potential issues with legacy or unsupported account types. For example:
if (!mcProfile.isMicrosoftAccount()) { throw new LoginException("Only Microsoft accounts are supported."); }This addition would provide an extra layer of security and clarity in the authentication process.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java (1 hunks)
- src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java (2 hunks)
🔇 Additional comments (2)
src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java (2)
60-60
: Change variable type toProfileKeys
for better abstractionChanging
wurstProfileKeys
fromProfileKeysImpl
toProfileKeys
uses the interface type, which improves abstraction and flexibility. This is a good practice that enhances code maintainability.
214-220
: Conditionally initializeUserApiService
based on session typeThe updated code correctly initializes
UserApiService
only when the session account type isMSA
, and defaults toUserApiService.OFFLINE
otherwise. This ensures thatProfileKeys
are only created for Microsoft accounts, preventing unnecessary key creation for cracked accounts as per the PR objectives.
Fixes #1068.
This PR only creates the ProfileKeys if the user is logged in to a Microsoft account. This is the way it is done in the vanilla code.