From 1a5c1eff7b5e3ee1fa4edf84cabfc9d3e6070f16 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 25 Apr 2024 20:20:43 +1000 Subject: [PATCH] Move passkey login to a button on the login page --- public/passkey/passkey.js | 5 ++++- resources/views/auth/login.blade.php | 29 ++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/public/passkey/passkey.js b/public/passkey/passkey.js index 8cc55c2..e0b3630 100644 --- a/public/passkey/passkey.js +++ b/public/passkey/passkey.js @@ -212,7 +212,10 @@ async function passkey_check(csrf_token,redirect) console.log('Passkey: Process Success'); // Direct to the home page - window.location.href = (redirect !== undefined) ? redirect : '/'; + if (data.success) + window.location.href = (redirect !== undefined) ? redirect : '/'; + else + alert(data.msg || 'Unknown error occurred'); }, error: function(e,status,error) { throw new Error(status || 'Unknown error occurred'); diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index bfb4908..8b5270a 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -73,14 +73,22 @@
- -
+
+
+ +
-
-
- Register +
+
+ Register +
+
+
+ +
+
@@ -94,6 +102,11 @@ @append \ No newline at end of file