Reputation: 113
I'm working on a small university project with Vue JS, Django2, Django Rest Framework where I have 2 different roles for the users so they can do different actions in the application.
I'm confused on the login part. I don't know how work with both frameworks(Vue and Django) for the authentication in my project. I've read about JWT, I understand how it works but I haven't used before. If there is not another way to work with the auth I'll use JWT.
Is there another way to work with authentication with both frameworks?
Upvotes: 3
Views: 11989
Reputation: 382
Yes, there are several ways of doing this. But I have done this using JWT. Access tokens are used to validate users at the backend. The access tokens and refresh tokens are generated by the django package(SimpleJWT). And at the frontend I have used Vuejs with Vuex to handle login,logout,etc.
You can look at my github repository here: https://github.com/nishant-boro/django_rest-vuejs-auth
This might be the exact thing you are looking for.
Upvotes: 8