diff --git a/adebisi-fa.jpg b/adebisi-fa.jpg index 51a8ab8..e57576c 100644 Binary files a/adebisi-fa.jpg and b/adebisi-fa.jpg differ diff --git a/app.py b/app.py index 4abd244..502163c 100644 --- a/app.py +++ b/app.py @@ -35,6 +35,8 @@ def enroll(sessionId, data): devices = ctx.get_devices() if (len(devices) == 0): print("There is no attached device.") + sio.emit('fprint-enroll-error', "There is no attached device."); + return; else: device = devices[0] if (not device): diff --git a/public/app.js b/public/app.js index 0c1de1e..38f00e2 100644 --- a/public/app.js +++ b/public/app.js @@ -34,6 +34,12 @@ var app = new Vue({ this.socket.on("connect", () => { }) + this.socket.on("fprint-enroll-error", (data) => { + console.log({ event: 'enroll-error', data }); + swal("Oops!", `Operation failed. ${data}.`, "error"); + this.busy.login = false; + }); + this.socket.on("fprint-enroll-done", (data) => { console.log({ event: 'enroll-done', data}); if (data.ok) { @@ -102,10 +108,10 @@ var app = new Vue({ saveFingerPrint: async function () { this.busy.login = true; try { - var fingerprints = Object.keys(this.fingerprints).map(finger => { + var fingerprints = Object.keys(this.fingerDetails).map(finger => { return { finger, - fingerprint: this.fingerprints[finger] + fingerprint: this.fingerDetails[finger] } }); var { data } = await axios.post(