@@ -21,37 +21,40 @@ sequenceDiagram
2121 participant IncodeAPI
2222 participant IndexedDB
2323
24- Note over Frontend: Enter hint:<br> email/phone/ identityId
24+ Note over Frontend: Enter hint:<br> identityId
2525 Note over Frontend: WebSDK: create()
2626 Frontend->>Backend: Start Session in Backend
2727 Backend->>IncodeAPI: Create new session<br>{configurationId, apikey}
2828 Note over IncodeAPI: /omni/start
2929 IncodeAPI-->>Backend: Returns Session<br>{token, interviewId}
30- Backend->>IndexedDB: Store session<br>{key: interviewId, backToken: token, used: false )
30+ Backend->>IndexedDB: Store session<br>{key: interviewId, backToken: token, status: pending, identityId )
3131 Backend-->>Frontend: Return Session<br>{token, interviewId}
3232
3333 Note over Frontend: WebSDK: renderAuthFace(token, hint)
3434 Note over Frontend: User completes face authentication
3535 Note over Frontend:Returns:<br>{candidate}
36-
37-
38- Frontend->>Backend: Mark Session as Completed<br>{token}
39- Note over IncodeAPI: /0/omni/finish-status
40- Backend->>IncodeAPI: Get finish status
41- IncodeAPI-->>Backend: Return:<br>{redirectionUrl, action}//Unused
42-
36+
4337 Frontend->>Backend: Validate Authentication<br>{interviewId, token, candidate}
4438 Backend->>IndexedDB: Get Session Info:<br>{key:interviewId}
4539 IndexedDB-->>Backend: {backToken, used}
4640 Note over Backend: Validate interviewId exists in DB
47- Note over Backend: Validate Session wasn't Used<br>used != True
48- Note over Backend: Validate tokens match<br>token === backToken
41+ Note over Backend: Validate Session isn't already verified<br>status = pending
42+ Note over Backend: Validate<br>candidate = session.identityId
43+ Note over Backend: Validate tokens match<br>token = backToken
44+
45+ Note over Backend,IndexedDB: Under any error or failed validation
46+ Backend->>IndexedDB: Mark session as Rejected<br>{interviewId, status:rejected}
47+
48+ Backend->>IncodeAPI: Mark session as completed
49+ Note over IncodeAPI: /0/omni/finish-status
50+ IncodeAPI-->>Backend: Return:<br>{redirectionUrl, action}//Unused
51+
4952 Backend->>IncodeAPI: Get Authentication Score<br>{token:backToken}
5053 Note over IncodeAPI: /0/omni/get/score
5154 IncodeAPI-->>Backend: {status, identityId}
52- Note over Backend: Validate candidate matches identityId<br> candidate === identityId
53- Note over Backend: Validate Score is OK:<br>status == = "OK"
54- Backend->>IndexedDB: Mark session as used<br>{interviewId, used:true }
55+ Note over Backend: Validate candidate matches identityId<br> candidate = identityId
56+ Note over Backend: Validate Score is OK:<br>score. status = "OK"
57+ Backend->>IndexedDB: Mark session as used<br>{interviewId, status:approved }
5558 Backend-->>Frontend: Return validation result<br>{message, valid, identityId}
5659 Note over Frontend: Show validation results
5760```
0 commit comments