Skip to content

Commit 734188c

Browse files
committed
define verified
1 parent 5c084c9 commit 734188c

File tree

1 file changed

+2
-3
lines changed
  • Node/quickstarts/firestore-sync-auth/functions

1 file changed

+2
-3
lines changed

Node/quickstarts/firestore-sync-auth/functions/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ exports.verifyComment = onDocumentWrittenWithAuthContext(
3636
// retrieve auth context from event
3737
const { authType, authId } = event;
3838

39+
let verified = false;
3940
if (authType === "system") {
4041
// system-generated users are automatically verified
4142
verified = true;
@@ -44,10 +45,8 @@ exports.verifyComment = onDocumentWrittenWithAuthContext(
4445
if (authId.endsWith("@example.com")) {
4546
verified = true;
4647
}
47-
} else {
48-
verified = false;
4948
}
50-
49+
5150
// add auth medadata to the document
5251
return data.after.ref.set(
5352
{

0 commit comments

Comments
 (0)