According to pyjwt docs it can be either datetime object or number (unix
epoch)
https://pyjwt.readthedocs.io/en/latest/usage.html#expiration-time-claim-exp
3.11.2017 9.37 "James Schneider" kirjoitti:
>
>
> On Oct 31, 2017 4:36 AM, "Rakhee Menon" wrote:
>
>
>
> class Login(APIView):
>
>def
if user:
payload = {
'id': user.pk,
'username': user.username,
'staff': user.email,
'exp': datetime.utcnow()
I think that datetime.utcnow() returns a datetime object, not a string, and
I don't think it can be serialized
On Oct 31, 2017 4:36 AM, "Rakhee Menon" wrote:
class Login(APIView):
def post(self, request, *args, **kwargs):
import ipdb;ipdb.set_trace()
username = request.POST.get('username')
password = request.POST.get('password')
user = Person.objects.get(username=username
class Login(APIView):
def post(self, request, *args, **kwargs):
import ipdb;ipdb.set_trace()
username = request.POST.get('username')
password = request.POST.get('password')
user = Person.objects.get(username=username, password=password)
#user = user[0]
As a simplest possible form you can pass jwt as s string:
"Xxx.yyyhgg.cxxch"
29.10.2017 19.33 "Rakhee Menon" kirjoitti:
> Unable to send jwt token as json response
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from th
5 matches
Mail list logo