Skip to content

Commit

Permalink
Patch fix for issues caused by adding type check in #5906 (#6127)
Browse files Browse the repository at this point in the history
  • Loading branch information
aalej authored Jul 19, 2023
1 parent 83c5292 commit 1f5f2ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
- Fixed bug where `firebase deploy --only firestore:named-db` didn't update rules. (#6129)
- Fixed issue where Flutter Web is not detected as a web framework. (#6085)
- Add better messages for API permissions failures that direct the user to the URL to enable the API. (#6130)
- Fixes issue caused by adding type checks in #5906.
6 changes: 4 additions & 2 deletions src/emulator/auth/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,15 @@ async function signUp(
}
}

if (typeof reqBody.email === "string") {
// Assert a valid email address when we expect the email to have a value.
// Prevents empty email and password string to be treated as anonymous sign in.
if (reqBody.email || (reqBody.email === "" && provider)) {
assert(isValidEmailAddress(reqBody.email), "INVALID_EMAIL");
const email = canonicalizeEmailAddress(reqBody.email);
assert(!state.getUserByEmail(email), "EMAIL_EXISTS");
updates.email = email;
}
if (typeof reqBody.password === "string") {
if (reqBody.password) {
assert(
reqBody.password.length >= PASSWORD_MIN_LENGTH,
`WEAK_PASSWORD : Password should be at least ${PASSWORD_MIN_LENGTH} characters`
Expand Down

0 comments on commit 1f5f2ac

Please sign in to comment.