From 1de108b0190af1ff1414eb4e7f057ff05d903e64 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Fri, 16 Dec 2022 22:05:45 +0100 Subject: [PATCH] Tweak OAuth2 registration params --- app/indieauth.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/indieauth.py b/app/indieauth.py index 90ce658..bf31a2b 100644 --- a/app/indieauth.py +++ b/app/indieauth.py @@ -46,7 +46,7 @@ async def well_known_authorization_server( class OAuthRegisterClientRequest(BaseModel): client_name: str - redirect_uris: list[str] + redirect_uris: list[str] | str client_uri: str | None = None logo_uri: str | None = None @@ -62,7 +62,9 @@ async def oauth_registration_endpoint( client = models.OAuthClient( client_name=register_client_request.client_name, - redirect_uris=register_client_request.redirect_uris, + redirect_uris=[register_client_request.redirect_uris] + if isinstance(register_client_request.redirect_uris, str) + else register_client_request.redirect_uris, client_uri=register_client_request.client_uri, logo_uri=register_client_request.logo_uri, scope=register_client_request.scope,