May 15th (Friday)

Nick Reynolds
May Days
Published in
2 min readMay 19, 2020

Today was slow progress as I was feeling lazy — I ended up playing some Animal Crossing and making slow and steady progress on Vita (a chunk of this was done the day before also).

Exercise

5km run and pushups (finished week 1 again!).

Vita

Got the landing page finished (for now) and somewhat integrated with Auth0 again.

Authentication and integration with Auth0 has definitely been a struggle to get this working with Next.js because:

  • There’s a mix of frontend and APIs in the same repo, each need to be authenticated differently
  • Pages are rendered server side (this can be disabled but it seems wasteful)
  • Pages can be pre-rendered and cached on the CDN (again can be disabled but it’s best practice to support this)

Good news I’ve seen this at Airbnb and know some of the pitfalls. Bad news is I’m finding it kind of complicated to think through the actual logic of it given I didn’t have my hands on the code at Airbnb. It seems especially complicated with a third party owning all authentication and login. Overall I landed on going with an architecture that is roughly:

  • All pages can be rendered without user data, any user data needed will be loaded async via APIs.
  • Authentication will happen on all APIs that hold user data. If the request contains a user session key then the backend will reach out to Auth0 to get the user information (user ID, etc.). If the user session is invalid or missing then the API will respond accordingly and will trigger authentication via a redirect or a button to log in.

I need to figure out how to avoid hitting Auth0 for all user requests and what sort of caching to do on the client side.

3D Printing

Sealant and primer arrived today, I’ve sealed the toothbrush holder and will deliver it to the new owner tomorrow!

Other

I made this great looking egg-white cocktail. It tasted awful.

Don’t judge a book by its cover

Movie night with friends after which we found out Lindsay had not seen Lord of the Rings at all. We watched the first half of the first movie then fell asleep.

--

--