DEV Community

Arash Jangali
Arash Jangali

Posted on

Tackling AuthToken Challenges, Embracing Simplicity, and Venturing into Web3

Introduction

On day 85 of my #100DaysOfCode journey, I faced the challenges of debugging an issue related to authentication tokens and CORS middleware, while also exploring the world of web3. In this blog post, I'll share my experience with resolving the AuthToken bug, discuss the importance of keeping code simple, and delve into my progress with the web3 module.

The AuthToken Bug and CORS Middleware

The bug that initially set me back was an issue with the server not sending the authentication token to the frontend, causing it not to be stored in the browser. I couldn't see it in the Chrome Developer Tools' Application panel. Despite having implemented CORS middleware to allow cross-origin resource sharing (since the frontend and backend are on different domains), the issue persisted. It was time to dive into debugging and figure out the root cause of the problem.

Debugging and Resolving the AuthToken Issue

After some investigation, I managed to fix the AuthToken issue by adjusting the server-side code to correctly send the token to the frontend. This allowed the token to be stored in the browser as expected, and I could finally see it in the Chrome Developer Tools.

Reevaluating and Simplifying Code

In the process of fixing the AuthToken issue, I had to delete some code I had written previously. This prompted me to reevaluate my approach and consider the importance of keeping code simple. Overcomplicating things can lead to more bugs and maintenance issues, so I decided to focus on a more straightforward solution that would still meet my objectives.

Progress with the Web3 Module

I also spent time diving into the web3 module, the last module in Angela Yu's full stack web dev bootcamp course on Udemy. It covers topics like blockchain, the internet computer, and building decentralized applications.

Conclusion

Day 85 of my #100DaysOfCode journey taught me valuable lessons about debugging, simplifying code, and exploring new technologies. Resolving the AuthToken bug reinforced the importance of keeping code as simple as possible, while diving into the web3 module expanded my skillset and understanding of the blockchain ecosystem. As I continue my coding journey, I'm eager to apply these lessons and further develop my skills.

Top comments (0)