Using OAuth in Quartz (the Obsidian Digital Garden)

I have a pretty decent vault in Obsidian. So I decided I should put it online for colleagues.
Since it has some sensitive info, I wanted to require a login to access it.
I managed a fully functional static website in cloudflare. But the login just doesn’t work.
ChatGPT decieved me by telling it would be easy. I followed every tutorial on Supabase and tried ChatGPT and Copilot instructions.
But when I try to log in with google, after it redirects back to my site, i get the following error:

GET https://that long url.supabase.co/auth/v1/user 401 (Unauthorized)
wich unfolds in:

(anonymous) @ auth-js.js:80
_handleRequest @ auth-js.js:422
_request @ auth-js.js:412
_getUser @ auth-js.js:1481
_getSessionFromURL @ auth-js.js:1704
_initialize @ auth-js.js:934
(anonymous) @ auth-js.js:918
(anonymous) @ auth-js.js:1388
(anonymous) @ auth-js.js:777

In the Network tab i get

  1. {message: “Invalid API key”, hint: “Double check your Supabase anon or service_role API key.”}
  2. hint: “Double check your Supabase anon or service_role API key.”
  3. message: “Invalid API key”

I checked dozens of times. I copied and pasted the supabase url and key several times again and again.

any directions on how to fix it?

thanks in advance

Hi @alvarezluiz :wave:

First off, thanks for making my day. This made me laugh out loud: “ChatGPT deceived me by telling it would be easy.” :smile: It happens to the best of us!

Re your question, it’s unclear to me how things are setup on your side. Can you provide a bit more information?

I’m assuming:

  • you have a WeWeb frontend
  • with the Supabase Auth plugin installed
  • and the correct API keys like you mentioned

Where I’m lost is what authentication system you setup in Supabase and what workflow you’re using in WeWeb. Could you share that with us?

Is it a simple email + password auth system in Supabase? Can you record a video where we see the user in Supabase and the workflow in WeWeb for example?

First, let me make you laugh again:
I reached this forum through google, straight to an anwer that was kind of specific. I don’t really remember what. BUT it made me think this forum was for general webdesign, deployment and all these stuff.

So, I’m not using WeWeb.
I’ll check what exactly WeWeb is after posting this silly post.

Currently, my pages are desgined in markdown in Obsidian, exported to htmll through quartz to Github. Then it is deployed via Quartz to Cloudflare.

This is the part that works.

But since Quartz generates a static website, that makes things very difficult to integrate with Supabase. Now I’m searching for alternatives.
I didn’t want to quit Quartz, but that’s still a possibility. Obsidian is the only thing that I won’t change. I have more than 3500 files, with links, there.

What makes matter worse is that I need any solution to be free. At least for now.