WeWeb / Supabase auth issue

Hi there, looking for some help in terms of setting up Supabase auth and then using the REST API to get data.

When sending a GET request:

  • If we send our request with the public key (via apikey) it works no problem
  • If we use the JWT after logging in with Supabase auth (Authorization : Bearer [key]) it does not work. We get a 401 error.

If we look at the Supabase logs for the unauthorized request, we can see that auth_userid has been found within Supabase. The RLS policy on the table we are trying to access currently allows anyone to read from it.

Any pointers as to what we’re missing?

You must use the public key, the user token is automatically sent with your request through cookie if you check “send credentials” I think

1 Like

Thank you, that’s helpful. I think this is perhaps more of a Supabase question then - but just to sense check. Since:

  • It works if I send just the public API key
  • It does not work if I send the public API key and select “Send credentials”

This says to me that Supabase has not been configured to allow that particular user to access that data. Will investigate, but if anyone has pointers that would be appreciated.

Supabase Auth is installed. I register a user. I receive an e-mail and confirm it. In Supabase you can see that the user is confirmed, but in Weweb the user is not visible. What is the reason?

What do you mean by “the user is not visible” ? On the users management panel ?

image
This is a confirmation that the email has been verified.

And these actions should hide the text if the user is logged into their account.

You have to use the signin method

The signup method automatically login the user only if there is no email verification required

(your email should redirect the user to the login page so he can login with the credentials they used to signup previously)