Skip to content

Commit 5992cac

Browse files
committed
feat: restrict people on dupes
1 parent c645a19 commit 5992cac

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

infrastructure/eid-wallet/src/routes/(app)/settings/+page.svelte

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,18 @@
3333
label="Language"
3434
href="/settings/language"
3535
/>
36-
<SettingsNavigationBtn
37-
icon={Link02Icon}
38-
label="History"
39-
href="/settings/history"
40-
/>
4136
<SettingsNavigationBtn
4237
icon={PinCodeIcon}
4338
label="Pin"
4439
href="/settings/pin"
4540
/>
46-
<SettingsNavigationBtn
47-
icon={Key01Icon}
48-
label="Keys"
49-
href="/settings/keys"
50-
/>
5141
<SettingsNavigationBtn
5242
icon={Shield01Icon}
5343
label="Privacy"
5444
href="/settings/privacy"
5545
/>
5646

57-
<ButtonAction callback={nukeWallet}>asdfasdf</ButtonAction>
47+
<ButtonAction class="mt-5 w-full" callback={nukeWallet}
48+
>Delete Account</ButtonAction
49+
>
5850
</main>

infrastructure/eid-wallet/src/routes/(auth)/verify/+page.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
eventSource.onmessage = function (e) {
5454
const data = JSON.parse(e.data);
5555
if (!data.status) console.log(data);
56-
console.log("STATUS", data.status);
56+
console.log("STATUS", data);
5757
status.set(data.status);
5858
reason.set(data.reason);
5959
person = data.person;
@@ -160,6 +160,8 @@
160160
<p>{$reason}</p>
161161
{:else}
162162
<h3>Your verification failed</h3>
163+
164+
<p>{$reason}</p>
163165
{/if}
164166
</div>
165167
<div class="flex w-full flex-col pt-4">

infrastructure/evault-provisioner/src/controllers/VerificationController.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ export class VerificationController {
200200
.json({ error: "Verification not found" });
201201
}
202202

203+
let status = body.data.verification.decision;
204+
let reason = body.data.verification.decision;
205+
203206
const affirmativeStatusTypes = [
204207
"approved",
205208
"declined",
@@ -211,8 +214,22 @@ export class VerificationController {
211214
body.data.verification.decision,
212215
)
213216
) {
214-
const approved =
217+
let approved =
215218
body.data.verification.decision === "approved";
219+
if (process.env.DUPLICATES_POLICY !== "allow") {
220+
const verificationMatch =
221+
await this.verificationService.findOne({
222+
documentId:
223+
body.data.verification.document.number.value
224+
});
225+
console.log("matched", verificationMatch)
226+
if (verificationMatch) {
227+
approved = false;
228+
status = "declined";
229+
reason =
230+
"Document already used to create an eVault";
231+
}
232+
}
216233
await this.verificationService.findByIdAndUpdate(id, {
217234
approved,
218235
data: {
@@ -225,8 +242,8 @@ export class VerificationController {
225242
}
226243

227244
eventEmitter.emit(id, {
228-
reason: body.data.verification.reason,
229-
status: body.data.verification.decision,
245+
reason,
246+
status,
230247
person: body.data.verification.person ?? null,
231248
document: body.data.verification.document,
232249
});

0 commit comments

Comments
 (0)