Skip to content

Commit

Permalink
Switch to get_url
Browse files Browse the repository at this point in the history
  • Loading branch information
elupus committed May 10, 2020
1 parent eca0d28 commit 5864f4d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion homeassistant/auth/providers/openid.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
_encode_jwt,
async_register_view,
)
from homeassistant.helpers.network import get_url

from . import AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, AuthProvider, LoginFlow
from ..models import Credentials, UserMeta
Expand Down Expand Up @@ -109,7 +110,8 @@ async def async_get_jwks(self) -> Dict[str, Any]:
@property
def redirect_uri(self) -> str:
"""Return the redirect uri."""
return f"{self.hass.config.api.base_url}{AUTH_CALLBACK_PATH}" # type: ignore
url = URL(get_url(self.hass, prefer_external=True, allow_cloud=False))
return str(url.with_path(AUTH_CALLBACK_PATH))

async def async_login_flow(self, context: Optional[Dict]) -> LoginFlow:
"""Return a flow to login."""
Expand Down

0 comments on commit 5864f4d

Please sign in to comment.