Skip to content

Commit 9e536b3

Browse files
committed
fix(handle-callback): mfix setting authentication_id on firestore doc before saving
1 parent e484146 commit 9e536b3

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/methods/handle-callback.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,8 @@ const handleCallback = client => {
2222
const { application, authentication } = reqBody
2323

2424
// preset Firestore document common values
25-
const firestoreDoc = collRef
26-
? {
27-
store_id: storeId,
28-
authentication_id: authenticationId
29-
}
30-
: null
31-
if (collRef && application) {
25+
const firestoreDoc = collRef ? { store_id: storeId } : null
26+
if (firestoreDoc && application) {
3227
Object.assign(firestoreDoc, {
3328
application_id: application._id,
3429
application_app_id: application.app_id,
@@ -121,6 +116,7 @@ const handleCallback = client => {
121116
})
122117
} else if (firestoreDoc) {
123118
// run Firestore collection set
119+
firestoreDoc.authentication_id = authenticationId
124120
collRef
125121
.doc(authenticationId)
126122
.set(firestoreDoc, { merge: true })

0 commit comments

Comments
 (0)