Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add getUserByEmail function to GoTrueAdminApi #949

Closed
wants to merge 2 commits into from

Conversation

J0
Copy link
Contributor

@J0 J0 commented Aug 29, 2024

What kind of change does this PR introduce?

Branched off of #933 and added a few suggestions. Please review alongside #933 as there is more context there

Original Auth issue: supabase/auth#880

  • Seems like a convenience method for the most part.

Tested locally

},
})

const users = response?.data?.user?.users || []
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this to a nullish check.

return { data: { user: users[0] }, error: null }
}

throw new UserNotFoundError()
Copy link
Contributor Author

@J0 J0 Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the initialization of the custom error to errors.ts for easier tracking and re-use

headers: this.headers,
xform: _userResponse,
query: {
filter: email,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped the URL Encode on email as _request seems to do URLEncoding here

Passing in an encoded email seems to lead to double encoding for me locally

@@ -915,7 +921,7 @@ export type AuthMFAEnrollResponse =
friendly_name?: string

/** Phone number of the MFA factor in E.164 format. Used to send messages */
phone: string
phone: string
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
phone: string
phone: string

@J0 J0 closed this Aug 29, 2024
@J0
Copy link
Contributor Author

J0 commented Aug 29, 2024

Closing for now, see rationale on supabase/auth#880

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