-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
Conversation
}, | ||
}) | ||
|
||
const users = response?.data?.user?.users || [] |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phone: string | |
phone: string |
Closing for now, see rationale on supabase/auth#880 |
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
Tested locally