mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-17 14:26:30 +00:00
Recommend ConfigEntryAuthFailed for reauthentication (#1048)
* raise ConfigEntryAuthFailed * Update config_entries_config_flow_handler.md
This commit is contained in:
parent
69615e1f0f
commit
6f0519ba66
@ -241,15 +241,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
|||||||
auth = api.AsyncConfigEntryAuth(...)
|
auth = api.AsyncConfigEntryAuth(...)
|
||||||
try:
|
try:
|
||||||
await auth.refresh_tokens()
|
await auth.refresh_tokens()
|
||||||
except TokenExpiredError:
|
except TokenExpiredError as err:
|
||||||
hass.async_create_task(
|
raise ConfigEntryAuthFailed(err) from err
|
||||||
hass.config_entries.flow.async_init(
|
|
||||||
DOMAIN,
|
|
||||||
context={"source": SOURCE_REAUTH},
|
|
||||||
data=entry.data,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
return False
|
|
||||||
|
|
||||||
# TODO: Proceed with component setup
|
# TODO: Proceed with component setup
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user