Add checks for invalid scopes in the auth approval process
This commit is contained in:
parent
b0dcb5d7e3
commit
d7a59ef0c2
2 changed files with 10 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Reference in a new issue