Skip to content

Commit 4f4431a

Browse files
committed
run lint fix
1 parent 0efd56d commit 4f4431a

File tree

1 file changed

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

1 file changed

+27
-27
lines changed

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

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,41 @@
2121
const {
2222
onDocumentWrittenWithAuthContext,
2323
} = require("firebase-functions/v2/firestore");
24-
const { logger } = require("firebase-functions");
24+
const {logger} = require("firebase-functions");
2525

2626
exports.verifyComment = onDocumentWrittenWithAuthContext(
27-
"comments/{commentId}",
28-
(event) => {
29-
const snapshot = event.data;
30-
if (!snapshot) {
31-
logger.log("No data associated with the event");
32-
return;
33-
}
34-
const data = snapshot.data();
27+
"comments/{commentId}",
28+
(event) => {
29+
const snapshot = event.data;
30+
if (!snapshot) {
31+
logger.log("No data associated with the event");
32+
return;
33+
}
34+
const data = snapshot.data();
3535

36-
// retrieve auth context from event
37-
const { authType, authId } = event;
36+
// retrieve auth context from event
37+
const {authType, authId} = event;
3838

39-
let verified = false;
40-
if (authType === "system") {
39+
let verified = false;
40+
if (authType === "system") {
4141
// system-generated users are automatically verified
42-
verified = true;
43-
} else if (authType === "unknown" || authType === "unauthenticated") {
44-
// admin users from a specific domain are verified
45-
if (authId.endsWith("@example.com")) {
4642
verified = true;
43+
} else if (authType === "unknown" || authType === "unauthenticated") {
44+
// admin users from a specific domain are verified
45+
if (authId.endsWith("@example.com")) {
46+
verified = true;
47+
}
4748
}
48-
}
4949

50-
// add auth medadata to the document
51-
return data.after.ref.set(
52-
{
53-
created_by: authId,
54-
verified,
55-
},
56-
{ merge: true }
57-
);
58-
}
50+
// add auth medadata to the document
51+
return data.after.ref.set(
52+
{
53+
created_by: authId,
54+
verified,
55+
},
56+
{merge: true},
57+
);
58+
},
5959
);
6060

6161
// [END all]

0 commit comments

Comments
 (0)