providers/oauth2: use in for prompt check
This commit is contained in:
parent
3759e96e7d
commit
a20ca9136b
|
@ -29,6 +29,7 @@ class RequestValidationError(SentryIgnoredException):
|
|||
if response:
|
||||
self.response = response
|
||||
|
||||
|
||||
class BaseMixin:
|
||||
"""Base Mixin class, used to annotate View Member variables"""
|
||||
|
||||
|
|
|
@ -341,21 +341,17 @@ class AuthorizationFlowInitView(PolicyAccessView):
|
|||
self.params = OAuthAuthorizationParams.from_request(self.request)
|
||||
except OAuth2Error as error:
|
||||
raise RequestValidationError(
|
||||
bad_request_message(
|
||||
self.request, error.description, title=error.error
|
||||
)
|
||||
bad_request_message(self.request, error.description, title=error.error)
|
||||
)
|
||||
except OAuth2Provider.DoesNotExist:
|
||||
raise Http404
|
||||
if self.params.prompt == PROMPT_NONE and not self.request.user.is_authenticated:
|
||||
if PROMPT_NONE in self.params.prompt and not self.request.user.is_authenticated:
|
||||
# When "prompt" is set to "none" but the user is not logged in, show an error message
|
||||
error = AuthorizeError(
|
||||
self.params.redirect_uri, "interaction_required", self.params.grant_type
|
||||
)
|
||||
raise RequestValidationError(
|
||||
bad_request_message(
|
||||
self.request, error.description, title=error.error
|
||||
)
|
||||
bad_request_message(self.request, error.description, title=error.error)
|
||||
)
|
||||
|
||||
def resolve_provider_application(self):
|
||||
|
|
Reference in a new issue