Skip to content

Commit

Permalink
fix: standardize the login successful response (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
corp-0 authored Mar 3, 2024
1 parent 947a250 commit 8b11038
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/accounts/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ def get_post_response_data(self, request, token, instance):
)

serializer = self.get_user_serializer_class()
data = {
"account": serializer(request.user, context=self.get_context()).data,
"token": token,
}

data = {"token": token}
if serializer is not None:
data["user"] = serializer(request.user, context=self.get_context()).data
return data

def get_user_serializer_class(self):
Expand Down

0 comments on commit 8b11038

Please sign in to comment.