User Authentication in Django REST Framework

前端 未结 3 479
长发绾君心
长发绾君心 2021-01-26 02:55

I have a Django REST backend, and it has a /users endpoint where I can add new users through POST method from frontend.

/users end

3条回答
  •  执念已碎
    2021-01-26 03:40

    You need to create an API that handles the user creation. This is why we create backends. The user will send the API their credentials and the API will add the user to the database using the admin credentials and post request. The API's code will not be viewable. Depending on your needs, auth0 can be a good solution and save you time on user registration and login. If you make your own sign up and login be sure to hash passwords and make sure they are sent over SSL. A service like auth0 will handle all this for you if you want to focus on other parts of your project.

提交回复
热议问题