Last active
May 24, 2018 03:19
-
-
Save kbrownlees/80cff182654f309b02870677b45e7bf1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SocialJWTCompleteAuthView(SocialJWTOnlyAuthView): | |
@method_decorator(never_cache) | |
def post(self, request, *args, **kwargs): | |
input_data = self.get_serializer_in_data() | |
self.set_input_data(request, input_data) | |
decorate_request(request, self.get_provider_name(input_data)) | |
partial = partial_pipeline_data(request.backend, request=request, *args, **kwargs) | |
if not partial: | |
raise ParseError() | |
user = request.backend.continue_pipeline(partial) | |
if isinstance(user, HttpResponse): | |
return user | |
resp_data = self.get_serializer(instance=user) | |
self.do_login(request.backend, user) | |
return Response(resp_data.data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment