Add checks for invalid scopes in the auth approval process

This commit is contained in:
Joseph Schorr 2014-03-18 17:05:27 -04:00
parent b0dcb5d7e3
commit d7a59ef0c2
2 changed files with 10 additions and 6 deletions

View file

@ -54,11 +54,12 @@ def get_scope_information(scopes_string):
scopes = scopes_from_scope_string(scopes_string)
scope_info = []
for scope in scopes:
scope_info.append({
'title': ALL_SCOPES[scope]['title'],
'scope': ALL_SCOPES[scope]['scope'],
'description': ALL_SCOPES[scope]['description'],
'icon': ALL_SCOPES[scope]['icon'],
})
if scope:
scope_info.append({
'title': ALL_SCOPES[scope]['title'],
'scope': ALL_SCOPES[scope]['scope'],
'description': ALL_SCOPES[scope]['description'],
'icon': ALL_SCOPES[scope]['icon'],
})
return scope_info

View file

@ -278,6 +278,9 @@ def request_authorization_code():
# Load the scope information.
scope_info = scopes.get_scope_information(scope)
if not scope_info:
abort(404)
return
# Load the application information.
oauth_app = provider.get_application_for_client_id(client_id)