-
-
Notifications
You must be signed in to change notification settings - Fork 36.3k
Let AuthenticationRequired also trigger the reauth flow in MusicAssistant #157580
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
Conversation
|
Hey there @music-assistant, @arturpragacz, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
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.
Pull request overview
This PR adds handling for AuthenticationRequired exception to trigger the reauth flow in the Music Assistant integration. This addresses a migration scenario where a Music Assistant server previously allowed connections without authentication but now requires it. The change ensures that users are prompted to reauthenticate when this situation occurs, rather than the integration failing to load.
Key changes:
- Added
AuthenticationRequiredimport frommusic_assistant_models.errors - Updated exception handler in
async_setup_entryto catchAuthenticationRequiredalongsideAuthenticationFailedandInvalidToken
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
Fixes a small oversight in the Music Assistant integration handling where the AuthenticationRequired error should also trigger the reauth flow. It handles the situation of a migration where previously the connection to the server was without token and now the server requires auth.
Also handles the case where the integration was previously configured using the manual URL and now can utilize the internal hassio addon flow, so we update the existing entry and reload it if it's in a failed state.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: