List supabase users instead of hardcoding uuid#71
Merged
Conversation
|
Your Render PR Server URL is https://core-pr-71-2lkx.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cjt0boabgj9c73d43smg. |
3mcd
approved these changes
Sep 7, 2023
Member
|
Nm, I see. I think the right way to do this is to setup a trigger that automatically creates the user in |
Member
|
A bit of discussion about why we don't have a trigger on user creation is here and under the pages/api/user description bullet in this PR. |
Member
|
I see. This feels like something we can add to the backlog and try for once
the sprint is over. I don’t think it’ll be too tough to replicate the
function in sql and we’ll get the benefit of atomicity. But we don’t need
it now.
…On Thu, Sep 7, 2023 at 20:54 Travis ***@***.***> wrote:
A bit of discussion about why we don't have a trigger on user creation is
here <https://github.com/pubpub/v7/tree/main/core#authentication> and
under the pages/api/user description bullet in this PR
<#48 (comment)>.
—
Reply to this email directly, view it on GitHub
<#71 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE4BBRHJR6WUKTKYXDLEWDXZJUEJANCNFSM6AAAAAA4PG7AOA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes login, which was failing because the UUID of our sole supabase auth user didn't match the UUID in the postgres database. I had hardcoded that value in the seed script previously, but the supabase auth user was deleted and recreated (not by the script) which gave it a new UUID.
To fix, instead of looking up the user by hardcoded id, we list all supabase users and just take the first one. This won't work once we have multiple users! But I'm not sure a better way at the moment because supabase doesn't let you look up users by email.