设备代码流在完成授权后隐藏二维码#6087
Conversation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request enhances the Microsoft device login flow by introducing a new 'DeviceLoginCompleted' state and event. This ensures that users are notified once the authorization step is finished while the launcher completes the remaining login tasks. The changes involve updates to the OAuth callback interface, the addition of a specific event class, and UI logic to display a completion hint. Review feedback correctly identified a grammatical error in the English localization and character inconsistencies in the Traditional Chinese translation, both of which included specific code suggestions for correction.
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds a completion event to the OAuth device login flow, enabling the UI to display a message once authorization is finished. It includes updates to the OAuth callback interface, event management, and localized strings. Reviewer feedback highlights the need for explicit error handling in the polling loop to avoid null tokens and suggests a grammatical fix for the English translation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request implements a completion event for Microsoft device code login, updating the UI to show a progress indicator and localized message once authorization is finished. Feedback was provided regarding the need for robust error handling in the OAuth polling loop to prevent incorrect success signals on failure, as well as a suggestion to correct the English grammar in the new localization string.
| continue; | ||
| } | ||
|
|
||
| options.callback.loginCompletedDeviceCode(); |
There was a problem hiding this comment.
The polling loop should handle other potential error responses from the token endpoint (e.g., access_denied if the user cancels the authorization). Currently, if an unhandled error occurs, the code incorrectly proceeds to call loginCompletedDeviceCode() and returns a Result with null tokens, which may cause issues later. It is safer to check for errors and throw an appropriate exception before signaling completion.
if (tokenResponse.error != null) {
handleErrorResponse(tokenResponse);
throw new RemoteAuthenticationException(tokenResponse.error, tokenResponse.errorDescription, "");
}
options.callback.loginCompletedDeviceCode();| account.methods.microsoft.hint=Click the "Log in" button to start adding your Microsoft account. | ||
| account.methods.microsoft.methods.device=Log In with QR Code | ||
| account.methods.microsoft.methods.device.hint=Scan QR code or visit <a href="%s">%s</a> to complete login, enter <b>%s</b> in the opened page. | ||
| account.methods.microsoft.methods.device.hint.completed=Microsoft account authorization is now completed. There are some extra works for us, just wait for a while. |
There was a problem hiding this comment.
The English phrasing "There are some extra works for us" is grammatically incorrect (work is uncountable here) and sounds unpolished. A more standard phrasing would improve the user experience.
account.methods.microsoft.methods.device.hint.completed=Microsoft account authorization is completed. The remaining steps will be performed automatically, please wait.
No description provided.