loading words...

Jan 20, 2019 21:45:06

Copypasta programming

by @swizecteller | 228 words | ๐Ÿฃ | 116๐Ÿ’Œ

Swizec Teller

Current day streak: 0๐Ÿฃ
Total posts: 116๐Ÿ’Œ
Total words: 32303 (129 pages ๐Ÿ“„)

Today I learned that in programming when you're stuck, you should copy the instructions. No, not follow the instructions, copypasta their code word for word.

Because copypasta will get you out of the weirdest shit imaginable. #200wordsTIL

https://www.youtube.com/watch?v=eWPpTIb98YM

---

So get this, I followed @auth0's instructions for adding authentication to your single page app. I was doing it with @gatsbyjs and that's just a small detail. The basics are the same:

1. Load auth0-js

2. Write an Auth object

3. Use the methods

4. Auth0 does the things

---

Yes I skimmed the guide, squinted, and said I got this. ๐Ÿ’ช

And I did ๐Ÿ‘‰ click login, get Auth0's page, redirect back to your app

aaaand an error. Something something state

---

That's weird. I did everything the instructions said. Days of scratching my head, trying to figure out how it all went so wrong.

Carefully went through the tutorial word for word. Asked questions. Nothing helped.

---

Then I find the official Auth0 + Gatsby article with a sample repo.

But they did the same things I did. ๐Ÿคจ

https://auth0.com/blog/building-a-blog-with-gatsby-react-and-webtask/

---

Yet the official implementation worked and mine did not.

Ok screw this, I'm copypasting their Auth object.

---

Fuck me it worked. Copypasting the damn code worked. Still not sure what's materially different ...

Mine on left, @mroliff's on right. His works mine doesn't. ๐Ÿคจ

https://www.diffchecker.com/VhIQ8vCu

Originally published at twitter.com

contact: email - twitter / Terms / Privacy