Technical Blog Article for HNG

wisdom - Jun 30 - - Dev Community

As a backend developer, producing quality code, testing and debugging is one of the important aspect of the job. Also, problem solving skills is another important aspect in backend development. In this article, I will share a recent difficult backend problem I encountered and how I solved it, I will also talk about why I am enthusiastic about HNG internship.

My Challenge: Implementing User Login.

I developed an admin dashboard using MongoDB, Express, React and Node.js. I incorporated a login system in my application to allow users register and log into their respective accounts.

How I solved it:

Database Setup:
The first step was to set up a database to store user details with fields for name, username and hashed password for registration. Password hashing was implemented for password security.

Password Hashing and Salting:
Password Hashing was used to protect user’s password from cybercriminals. In password hashing, the original password or value cannot be recovered which makes it different from encryption where the original value can be retrieved with the correct secrete key used to encrypt the value in the first place. User password were hashed before storing them in the database. Also, I made use of salting which is unique to each password and it’s attached to it before hashing providing extra security. This ensures that even if two users have the same password, their hashed value will be different due to unique salts.

Login Endpoint:
Login endpoint was created to handle user authentication. When a user submits their login details by clicking on the submit button, the system retrieved the hashed password and salts for the username in the database, hashed the provided password the user sent to the server and compare the retrieved hashed password and provided hash password. If the hash matches, the system authenticates the user.

Generating Tokens:
I created a JSON Web Token (JWT) when the user logs in/authenticates to maintain user session. The token generated contains user’s information it remains valid for a limited period of time.

My Journey with HNG Internship
As a backend developer with focus on MERN stack. I love working on backend projects and staying up to date with latest technologies. As I engage in HNG internship, I have full confidence that it will help me upgrade my skills as a backend developer and also collaborate with experienced backend developers to work on real world problem.

WHY HNG INTERNSHIP?
I’m excited about my internship with HNG because it will help me upgrade my skills as a backend developer and also a valuable addition to my resume thereby giving me an edge in the labour market.
https://hng.tech/internship

. .