Well, like the title says, I have been working on this project for 5 weeks, it feels like 5 years. Everything is progressing even if we are traveling at micrometers/sec, we are still chugging along. Why do I think progress is slow, well it is because we are getting to the stage where my team and I have done all the easy part so far, and now we are moving on to the hard stuff.
Keep in mind, when I say easy, I mean that there are lots of resources online which can allow for quick lookup and solutions. It is only easy if you already know what you are looking for, and are just using the solutions as a reference. Now for this week, I was assigned to make the login persistent throughout the site as well as set up account authentication. This entailed that I had to research, implement, and test how to do that, and lets say that came with its own host of problems.
First of all I had to understand the scope of this problem, and well it can be very simple as in storing the everything in local storage and calling it up on refresh, or it can be as confusing as setting up access tokens and refresh tokens (for security reasons). Let me tell you how that went. Everybody knows the 5 stages of grief: denial, anger, bargaining, depression and acceptance, well here are the stages I reached when I was trying to implement persistent login.
Denial: Initially, I was making big plans I was going to do this properly and follow through on the best practice, set up access tokens and even refresh tokens, it was going to be great. Then I realized that would require too much time, and so I settled for just access tokens, which were not secure at all. Did I mention most of the tutorials utilized class based components when I was using function based component, so I had to do additional translation in order to get started on understanding it. Throughout the entire time in my head I was telling myself, “No way it is going to get harder than this”, and it did.
Anger: At one point a perfectly working code stopped working, and that was after I had everything set up and behaving as expected. I was pulling my hair trying to figure out what the issue was. I deleted and restored, even went as far back as restarting the web server, I was frustrated, mad, and wanted to give up. When all hope was lost, it started working again, I have no idea what the issue was and I am hoping that was a one time thing. I am still angry over it.
Bargaining: Throughout the entire process, I was just telling myself, ‘Okay, lets spend one more day on it”. As the days roll by, “Okay, lets just make my teammates handle this”. I was switching between implementation saying “this time will be different”, when I should have stuck with one and try to make it work. Did I mention, I did not want to learn redux.
Depression: Ya, I was depressed
Acceptance: After finishing everything, I wanted to do some css, include a drop down menu in the nav bar, you know simple stuff. Well that was the last straw that broke the camel’s back. I folded so fast it was not even funny. After giving up because the drop down menu was not showing up, I felt liberated, because I realized that I accomplished one of my main tasks for this week. I was able to relax.
This entire week was a nightmare, hopefully it gets better. Looking back, the implementation of this task was not that bad, but arriving to it was the hard part.