mirror of
https://github.com/andwati/store-api.git
synced 2026-10-18 09:22:53 +00:00
API complete
This commit is contained in:
@@ -31,7 +31,7 @@ class LoginView(GenericAPIView):
|
||||
user = auth.authenticate(username=username, password=password)
|
||||
|
||||
if user:
|
||||
auth_token = jwt.decode({"username": user.username}, settings.JWT_SECRET_KEY)
|
||||
auth_token = jwt.encode({"username": user.username}, settings.JWT_SECRET_KEY)
|
||||
serializer = UserSerializer(user)
|
||||
data = {"user": serializer.data, "token": auth_token}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user