Skip to content

Commit

Permalink
Getting The current user using /auth//user/me and installing modheade…
Browse files Browse the repository at this point in the history
…r chrome extension and setting access token
  • Loading branch information
ajmalshahabudeen committed Apr 20, 2023
1 parent 4e21364 commit 572ad9a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Test Token.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY4MjA1Mjk3NCwianRpIjoiOWE0N2RhNjJiMzA3NGE2Mzk1MmE3MTViZmNmMWIwZjciLCJ1c2VyX2lkIjo0fQ.fgQNVp9gzgNMZjTNR_se3Jt_6tGsE-OsrQTIlAgaSV0

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjgyMDYxOTI1LCJqdGkiOiIwNjAxNDM3NDZhMWY0ZDg5YWRlYTczZTQyYTg5NmRjMiIsInVzZXJfaWQiOjR9.UWi1_oOctrkoJiAWpQ4NN91dsmPzjpyxQT04g8sZWVY
8 changes: 6 additions & 2 deletions core/serializers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from djoser.serializers import UserCreateSerializer as BaseUserCreateSerializer
from djoser.serializers import UserSerializer as BaseUserSerializer, UserCreateSerializer as BaseUserCreateSerializer

class UserCreateSerializer(BaseUserCreateSerializer):
class Meta(BaseUserCreateSerializer.Meta):
fields = ['id', 'username', 'password','email', 'first_name', 'last_name']
fields = ['id', 'username', 'password','email', 'first_name', 'last_name']

class UserSerializer(BaseUserSerializer):
class Meta(BaseUserSerializer.Meta):
fields = ['id', 'username', 'email', 'first_name', 'last_name']
3 changes: 2 additions & 1 deletion storefront/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@

DJOSER = {
'SERIALIZERS':{
'user_create': 'core.serializers.UserCreateSerializer'
'user_create': 'core.serializers.UserCreateSerializer',
'current_user': 'core.serializers.UserSerializer',
}
}

Expand Down

0 comments on commit 572ad9a

Please sign in to comment.