-
Notifications
You must be signed in to change notification settings - Fork 950
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
Updated to fix issues-4170 #7980
base: master
Are you sure you want to change the base?
Conversation
Note: Needs a CHANGELOG entry before merge. |
src/emulator/auth/operations.ts
Outdated
@@ -1232,8 +1231,20 @@ export function setAccountInfoImpl( | |||
} | |||
} | |||
|
|||
if (reqBody.linkProviderUserInfo) { | |||
if (!reqBody.linkProviderUserInfo.providerId?.length) { | |||
throw new Error("providerId is required and must be a non-empty 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.
These should use assert
to throw a client error instead of internal error, but I don't know what the correct error codes should be. Maybe we can settle with assert(condition, "TODO_ERROR_CODE : missing providerId")
for now
.query({ key: "fake-api-key" }) | ||
.send({ idToken, linkProviderUserInfo: incompleteProviderUserInfo2 }) | ||
.catch((err) => { | ||
expect(err.response.status).to.equal(500); // Expecting internal server error since it's a missing validation |
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.
As mentioned above, let's make this a 400
PTAL at the unit test failures and I can do another round of review after |
Description
Closes: #4170
This PR fixes the issue and adds feature of
linkProviderUserInfo
in auth emulator.Scenarios Tested