DEV Community

Joshua Minchew
Joshua Minchew

Posted on

Day1 - sacredscrolls development

Today, I began working as one of the backend developers on SacredScrolls, a full-stack web application that allows users to study the Bible, Quran, and the Bhagavad Gita all in one place. Whether you are a religious individual seeking a deeper connection with your faith or someone interested in academic learning, SacredScrolls provides a comprehensive platform.

I focused on user authentication and authorization today, successfully implementing authentication with a username and password, followed by authorization using the token received upon login. At the moment, the token allows users to view their user information.

However, I encountered an issue while attempting to use Django's authentication method, which should return a user object if the credentials are correct. Regardless of the accuracy of the credentials, I consistently received None. I identified the problem as creating a user via the serializer.save() method. I initially used this approach to validate incoming JSON data with serializer.is_valid(). The problem with using .save() to create a user object is that it saves the object as plaintext in the database. In contrast, using Django's create_user() method hashes the password before storing it. The authentication method expected the password in the database to be hashed, leading to the issue.

In summary, today, as a backend developer on "sacredscrolls," I worked on implementing user authentication and authorization for studying religious texts. While successfully integrating authentication and token-based authorization, I faced a challenge due to storing passwords as plaintext using serializer.save(), causing issues with Django's authentication method, which expects hashed passwords from create_user().

Top comments (0)