Move allow logic to authorize view.
This commit is contained in:
parent
db001cae1e
commit
124c7366fa
|
@ -80,14 +80,7 @@ class AuthorizeEndpoint(object):
|
|||
except Client.DoesNotExist:
|
||||
raise ClientIdError()
|
||||
|
||||
def create_response_uri(self, allow):
|
||||
|
||||
if not allow:
|
||||
raise AuthorizeError(
|
||||
self.params.redirect_uri,
|
||||
'access_denied',
|
||||
self.grant_type)
|
||||
|
||||
def create_response_uri(self):
|
||||
try:
|
||||
self.validate_params()
|
||||
|
||||
|
|
|
@ -73,7 +73,12 @@ class AuthorizeView(View):
|
|||
allow = True if request.POST.get('allow') else False
|
||||
|
||||
try:
|
||||
uri = authorize.create_response_uri(allow)
|
||||
if not allow:
|
||||
raise AuthorizeError(authorize.params.redirect_uri,
|
||||
'access_denied',
|
||||
authorize.grant_type)
|
||||
|
||||
uri = authorize.create_response_uri()
|
||||
|
||||
return HttpResponseRedirect(uri)
|
||||
|
||||
|
|
Loading…
Reference in a new issue