Skip to content

Commit 5ab6075

Browse files
committed
Accepts approval_prompt query parameter. If it is anything other than 'auto' (the default if not specified) it will force the prompt.
1 parent 94e02d9 commit 5ab6075

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

oauth2_provider/views/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ def get(self, request, *args, **kwargs):
117117

118118
# Check to see if the user has already granted access and return
119119
# a successful response
120-
if request.user.accesstoken_set.filter(
120+
require_approval = request.get('approval_prompt', 'auto') == 'auto'
121+
if not require_approval and request.user.accesstoken_set.filter(
121122
application=kwargs['application'],
122123
expires__gt=datetime.datetime.now()).count():
123124
uri, headers, body, status = self.create_authorization_response(

0 commit comments

Comments
 (0)