Skip to content

Conversation

Raflos10
Copy link
Contributor

@Raflos10 Raflos10 commented May 7, 2025

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Due to an update I made a while ago, errors received from /signup are never returned by sign_up_with_email_and_password, because EmailSignUpConfirmation deserialization always succeeds even if the json didn't match, because it has all optional properties.

What is the new behavior?

EmailSignUpConfirmation now has mostly required properties, so it won't deserialize if the result from supabase was an error.

Additional context

I don't remember why I made EmailSignUpConfirmation have all optional properties, I was probably going off of the js auth client as an example, but I can't think of a reason they need to be optional. Let me know if you do. I also removed the Serialize trait since it's only deserialized.

@Raflos10 Raflos10 had a problem deploying to test-environment May 7, 2025 09:51 — with GitHub Actions Failure
@Proziam
Copy link
Collaborator

Proziam commented May 10, 2025

I have a sneaking suspicion there may be conditions where there are optional fields in the response, such as cases when a user signs up without a phone number and thus there is no phone to populate the field.

I don't know all the possible permutations of the response, but if you want to do some manual testing to verify which fields we can tighten up that would certainly be welcome!

UPDATE: After some manual testing this seems to work fine, so I'll merge. Thank you again for helping out!

@Proziam Proziam merged commit c1a249c into supabase-community:main May 10, 2025
1 check failed
@Raflos10 Raflos10 deleted the email-confirmation-silent-errors branch May 10, 2025 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants