Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Sara / Added ids to onfido documents #6608

Merged
merged 5 commits into from
Jun 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/javascript/app/pages/user/account/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,10 +865,12 @@ const Authenticate = (() => {
phrases : onfido_phrases,
mobilePhrases: onfido_phrases,
},
token : sdk_token,
useModal : false,
onComplete: handleComplete,
steps : [
token : sdk_token,
useModal: false,
onComplete(data) {
handleComplete(data);
},
steps: [
{
type : 'document',
options: {
Expand Down Expand Up @@ -911,11 +913,16 @@ const Authenticate = (() => {
}
};

const handleComplete = () => {
const handleComplete = (data) => {
const document_ids = Object.keys(data).map(key => data[key].id);

BinarySocket.send({
notification_event: 1,
category : 'authentication',
event : 'poi_documents_uploaded',
args : {
documents: document_ids,
},
}).then(() => {
onfido.tearDown();
$('#authentication_loading').setVisibility(1);
Expand Down