Move validate_params function to views (on POST authorize).
This commit is contained in:
parent
06392c7600
commit
48fcb1da93
|
@ -82,8 +82,6 @@ class AuthorizeEndpoint(object):
|
|||
|
||||
def create_response_uri(self):
|
||||
try:
|
||||
self.validate_params()
|
||||
|
||||
if self.grant_type == 'authorization_code':
|
||||
code = create_code(
|
||||
user=self.request.user,
|
||||
|
@ -95,7 +93,7 @@ class AuthorizeEndpoint(object):
|
|||
# Create the response uri.
|
||||
uri = self.params.redirect_uri + '?code={0}'.format(code.code)
|
||||
|
||||
else: # Implicit Flow
|
||||
elif self.grant_type == 'implicit':
|
||||
id_token_dic = create_id_token(
|
||||
user=self.request.user,
|
||||
aud=self.client.client_id)
|
||||
|
|
|
@ -73,6 +73,8 @@ class AuthorizeView(View):
|
|||
allow = True if request.POST.get('allow') else False
|
||||
|
||||
try:
|
||||
authorize.validate_params()
|
||||
|
||||
if not allow:
|
||||
raise AuthorizeError(authorize.params.redirect_uri,
|
||||
'access_denied',
|
||||
|
|
Loading…
Reference in a new issue