diff --git a/app/oauth/views/authorize.py b/app/oauth/views/authorize.py index e4e9f60b..98a0b08a 100644 --- a/app/oauth/views/authorize.py +++ b/app/oauth/views/authorize.py @@ -72,16 +72,16 @@ def authorize(): if not client: return redirect(url_for("auth.login")) - # check if redirect_uri is valid # allow localhost by default # allow any redirect_uri if the app isn't approved hostname, scheme = get_host_name_and_scheme(redirect_uri) - if hostname != "localhost" and hostname != "127.0.0.1" and client.approved: + if hostname != "localhost" and hostname != "127.0.0.1": # support custom scheme for mobile app if scheme == "http": final_redirect_uri = f"{redirect_uri}?error=http_not_allowed" return redirect(final_redirect_uri) + # check if redirect_uri is valid if not RedirectUri.get_by(client_id=client.id, uri=redirect_uri): final_redirect_uri = f"{redirect_uri}?error=unknown_redirect_uri" return redirect(final_redirect_uri) diff --git a/templates/oauth/authorize.html b/templates/oauth/authorize.html index 99853c7f..fa91aca4 100644 --- a/templates/oauth/authorize.html +++ b/templates/oauth/authorize.html @@ -36,7 +36,7 @@