File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -323,10 +323,18 @@ def device_flow_token_response(
323
323
device = Device .objects .get (device_code = device_code )
324
324
325
325
if device .status == device .AUTHORIZATION_PENDING :
326
- raise AuthorizationPendingError
326
+ pending_error = AuthorizationPendingError ()
327
+ return http .HttpResponse (
328
+ content = pending_error .json , status = pending_error .status_code , content_type = "application/json"
329
+ )
327
330
328
331
if device .status == device .DENIED :
329
- raise AccessDenied
332
+ access_denied_error = AccessDenied ()
333
+ return http .HttpResponse (
334
+ content = access_denied_error .json ,
335
+ status = access_denied_error .status_code ,
336
+ content_type = "application/json" ,
337
+ )
330
338
331
339
url , headers , body , status = self .create_token_response (request )
332
340
You can’t perform that action at this time.
0 commit comments