Hello👋🏽, Everyone has a story to tell. Well, I have a lot to tell but I'll be sharing my journey as a backend developer on this post. I never studied anything related to computer science or software engineering so getting into tech was difficult.
I started as a frontend developer and decided to dive into backend so as to enhance my skill. When it comes to learning new technologies, my approach is to watch a video first, then read the docs or any article to understand more of it.
Recently, I started working with typescript on the backend and I was trying out passport js for both email and password authentication and google authentication for the first time and had to figure out how to get it done. Here are the steps I followed:
STEP1 I set up my node js project and install dependencies needed for the project.
STEP2 Configuring typescript to the project was done next and also I installed the types for the packages I had installed in #1.
STEP3 Setting up passport. I had installed passport-local for local strategy and passport-google-oauth2 for google strategy.
STEP4 I added passport.serialize function which gets called on login and passport.deserialize which gets called when other routes are accessed and attaches the user to the request object.
STEP5 I ensured I properly set up my Oauth consent screen and gotten my clientId and client secret credential from google cloud console.
STEP6 Setting up routes. For the local strategy, I set up the route and called passport.authenticate("local") and for google startegy, it was passport.authenticate("google").
STEP7 The last step was the test the routes to make sure it works as expected.
Currently, I'm excited to start my journey at HNG11 internship. This will be an opportunity for my to do more than just authentication, build impactful projects and collaborate with other developers. You can find more about the project at [https://hng.tech/internship,https://hng.tech/hire].
I'll be sharing more about my tech journey on this space and I hope you get value from my updates.
Top comments (0)