Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions homeassistant/helpers/config_entry_oauth2_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
DATA_PROVIDERS = "oauth2_providers"
AUTH_CALLBACK_PATH = "/auth/external/callback"
HEADER_FRONTEND_BASE = "HA-Frontend-Base"
MY_AUTH_CALLBACK_PATH = "https://my.home-assistant.io/redirect/oauth"

CLOCK_OUT_OF_SYNC_MAX_SEC = 20

Expand Down Expand Up @@ -129,6 +130,9 @@ def domain(self) -> str:
@property
def redirect_uri(self) -> str:
"""Return the redirect uri."""
if "my" in self.hass.config.components:
return MY_AUTH_CALLBACK_PATH

if (req := http.current_request.get()) is None:
raise RuntimeError("No current request in context")

Expand Down