I'm using vue.js for the front end of my application which is made on Django-restframework. I am using django-rest-auth for social authentication via Google.
On the front end, I am using the vue-google-oauth2 library. The two work fine. I send an auth code from the front end and the backend responds with a token key. However, when I use curl on my terminal with the key
curl -X GET http://127.0.0.1:8000/api/example/ -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'
I get the error:
{"detail":"Authentication credentials were not provided."}
With my terminal showing:
[06/Mar/2019 15:38:54] "GET /newsfeed/ HTTP/1.1" 401 58
What is it that I am supposed to do to ensure that the cookies or whatever it is at the backend to maintain my session isn't lost?
Similarly, when I login on the front end using the oauth2 library, I refresh my page and that too shows that I am no longer logged in.
What exactly am I missing out on?