Skip to content

Commit

Permalink
feat: adds some gifs and images to auth-is-hard
Browse files Browse the repository at this point in the history
  • Loading branch information
DBozhinovski committed Aug 8, 2024
1 parent 18e92e9 commit 1d444ab
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
Binary file added content/but-auth-is-hard/8zmj3k.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions content/but-auth-is-hard/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Nowadays, the narrative has changed. "Auth is hard" feels like an ever-present n

So, how hard can auth really be? Let's dig in.

![Pepperidge farm remembers...](/8zmj3k.jpg)

## In the days of yore...

Picking up where I left the story about PHP and md5, building a login functionality followed a similar set of steps; Get an email and a password, check for the existence of the email in your storage, hash the password together with the salt stored for that email, compare the resulting hash with the one stored in the database, and if it all works out fine, set a cookie via `setcookie` (we're still in PHP land here - not that the overall logic was too different in other ecosystems).
Expand Down Expand Up @@ -70,6 +72,8 @@ First off, we need one more dependency, `npm i passport-github2`. [passport-gith

Some handlers (https://github.com/supertokens/auth-express/blob/master/index.mjs#L122-L133) and configuration (https://github.com/supertokens/auth-express/blob/master/index.mjs#L29-L45) later, well, that's it. Complicated? Probably not. Red-tapey? You bet. Boring? Absolutely. Especially if you get to do it over and over again. It is a solved problem; reinventing wheels is often not the best use of one's time as we've established.

![What's your point?](/tenor-3826355393.gif)

## The big idea

By now, we can probably agree that Auth isn't hard to _build_. Ergo, it's not this magical thing that only white-bearded wizards who speak the mystical language of JWTs can understand and implement.
Expand Down Expand Up @@ -132,4 +136,6 @@ So, even if you're not into using third-party software for Auth, you can just pi

## The takeaway: auth is the "red tape" of dev

![Staaaaaaaaaaaaaaaaaaaaaaamp](/stamps.gif)

My "big" takeaway is to avoid reinventing wheels, especially if it's a solved problem, as auth is. Get educated about said wheels, experiment with them, build a toy wheel, and understand it. But please, please, don't sell it as this impossibly hard thing to understand and build. Educate, don't gatekeep.
Binary file added content/but-auth-is-hard/stamps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/but-auth-is-hard/tenor-3826355393.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1d444ab

Please sign in to comment.