File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -175,11 +175,10 @@ Now define an endpoint for authorization. This endpoint is used by
175
175
if request.method == 'GET':
176
176
try:
177
177
grant = server.get_consent_grant(end_user=current_user)
178
- except OAuth2Error:
178
+ except OAuth2Error as error :
179
179
return authorization.handle_error_response(request, error)
180
180
181
- client = grant.client
182
- scope = client.get_allowed_scope(grant.request.scope)
181
+ scope = grant.client.get_allowed_scope(grant.request.scope)
183
182
184
183
# You may add a function to extract scope into a list of scopes
185
184
# with rich information, e.g.
@@ -188,13 +187,14 @@ Now define an endpoint for authorization. This endpoint is used by
188
187
'authorize.html',
189
188
grant=grant,
190
189
user=current_user,
191
- client=client,
192
190
scopes=scopes,
193
191
)
192
+
194
193
confirmed = request.form['confirm']
195
194
if confirmed:
196
195
# granted by resource owner
197
196
return server.create_authorization_response(grant_user=current_user)
197
+
198
198
# denied by resource owner
199
199
return server.create_authorization_response(grant_user=None)
200
200
You can’t perform that action at this time.
0 commit comments