@@ -38,8 +38,10 @@ def handle(self, request, *args, **kwargs):
38
38
return super ().handle (request , * args , ** kwargs )
39
39
40
40
def post (self , request , * args , ** kwargs ):
41
- flows .signup .signup_by_form (self .request , self .sociallogin , self .input )
42
- return AuthenticationResponse (request )
41
+ response = flows .signup .signup_by_form (
42
+ self .request , self .sociallogin , self .input
43
+ )
44
+ return AuthenticationResponse .from_response (request , response )
43
45
44
46
def get_input_kwargs (self ):
45
47
return {"sociallogin" : self .sociallogin }
@@ -93,10 +95,11 @@ class ProviderTokenView(APIView):
93
95
94
96
def post (self , request , * args , ** kwargs ):
95
97
sociallogin = self .input .cleaned_data ["sociallogin" ]
98
+ response = None
96
99
try :
97
- complete_token_login (request , sociallogin )
100
+ response = complete_token_login (request , sociallogin )
98
101
except ValidationError as e :
99
102
return ErrorResponse (self .request , exception = e )
100
103
except SignupClosedException :
101
104
return ForbiddenResponse (self .request )
102
- return AuthenticationResponse (self .request )
105
+ return AuthenticationResponse . from_response (self .request , response )
0 commit comments