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)

I apologize, but I didn’t quite understand your message.


I have this user visible in “Users”, but no metadata

You’re not logged in when you confirm your email, you’re logged in when you go through the sign in action

Use a form to allow your user to login, he will enter his email and password, on the click you will execute the sign in plugin action, and only at this moment the variable user and isAuthenticated will be filled

OK, it works like this, but I have the following registration logic:

  • The user is offered to Sign In to the account, if he has not registered, he goes to Sign Up,
  • There he enters Name, Email, Password and after clicking the button the message “Confirm your email” appears,
  • After confirmation he should be redirected to the page “Setting” for further customization of the profile, because there he needs to enter more information to use the application.
    Where and what do I need to configure in this case?

I think what Alexis is trying to say is that after your third - confirmation step - you need to also go and prompt the user to log in.

On your login action you could try to check if the profile is complete, if not you can redirect the user to the setting page instead of the usual page