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