This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-19
Channels
- # announcements (3)
- # beginners (29)
- # biff (10)
- # calva (33)
- # cider (1)
- # clara (8)
- # clerk (10)
- # clj-kondo (6)
- # cljs-dev (5)
- # clojure (40)
- # clojure-dev (3)
- # clojure-europe (43)
- # clojure-gamedev (1)
- # clojure-nl (1)
- # clojure-norway (19)
- # clojure-uk (2)
- # clr (3)
- # cursive (12)
- # datomic (4)
- # devcards (3)
- # gratitude (3)
- # honeysql (13)
- # hoplon (25)
- # humbleui (3)
- # hyperfiddle (38)
- # malli (26)
- # pathom (38)
- # practicalli (2)
- # rdf (6)
- # reagent (8)
- # shadow-cljs (13)
- # xtdb (1)
I'm having a little trouble with reCAPTCHA and I'm not sure how to debug it. Basically, I've got both the sign-in process that sends the 6-digit code and the sign-up process that sends the link. When I test the sign-in, it seems to be working. When I test the sign-up, I always fail the recaptcha. After failing the recaptcha, if I click over to the sign-in side of things and try that, it will fail, too, until I close the tab and reopen. Then I'm back to sign-in working and sign-up failing.
Well, as always, merely typing this in made me realize the root of my problem. I'm using
hx-boost
: https://htmx.org/attributes/hx-boost/ And it trips me up once in a while, because it uses htmx magic to replace the innerHTML
of the <body>
. I don't know exactly how this messed up the recaptcha script, but when I added {:hx-boost "false"}
to my sign-up and sign-in links, it cleared up. So, just in case someone else is encountering a similar issue, there you have it!
ah good to know! I think the example project doesn't run into this since it only uses htmx after you've signed in
It made for a nice brain teaser! I have the hx-boost
attribute in the body of every page, which I was enjoying because I could do something like make a button that toggles a dark mode class on the body and the class would persist from page to page. But like I said, it does trip me up from time to time.
for dark mode you can use local storage to persist the setting. There's a snippet for that in platypub somewhere
(the script is inlined so it executes sooner)
I need to spend some time digging through platypub. I have a feeling it already does a lot of the things I'm going to want to do. Like, at some point, I'm going to have to figure out how to upload and display images.
ah yes there's code for that already :) that would be a good candidate for a how-to article